diff options
author | Douglas Gilbert <dgilbert@interlog.com> | 2022-04-21 02:37:15 +0000 |
---|---|---|
committer | Douglas Gilbert <dgilbert@interlog.com> | 2022-04-21 02:37:15 +0000 |
commit | 8cd2200ba1758cd127a1b95ab1808cde4f56713c (patch) | |
tree | 81f7e8e9c995548351865b77c13092ebf40d7174 /src/sg_turs.c | |
parent | f26bb872bf4f043a1b817c808a6947fcb03ecda4 (diff) | |
download | sg3_utils-8cd2200ba1758cd127a1b95ab1808cde4f56713c.tar.gz |
sg_opcodes: add --inhex=FN to process earlier -HHH, add experimental --json[=JO] option; sg_turs: change nanosleep() to Sleep() in MinGW
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@945 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'src/sg_turs.c')
-rw-r--r-- | src/sg_turs.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/sg_turs.c b/src/sg_turs.c index 7b575911..3c7c7a1f 100644 --- a/src/sg_turs.c +++ b/src/sg_turs.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2021 D. Gilbert + * Copyright (C) 2000-2022 D. Gilbert * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) @@ -45,7 +45,7 @@ #include "sg_pr2serr.h" -static const char * version_str = "3.49 20210830"; +static const char * version_str = "3.50 20220418"; #define DEF_PT_TIMEOUT 60 /* 60 seconds */ @@ -330,6 +330,19 @@ parse_cmd_line(struct opts_t * op, int argc, char * argv[]) return res; } +#ifdef SG_LIB_MINGW + +#include <windows.h> + +static void +wait_millisecs(int millisecs) +{ + /* MinGW requires pthreads library for nanosleep, use Sleep() instead */ + Sleep(millisecs); +} + +#else + static void wait_millisecs(int millisecs) { @@ -341,6 +354,8 @@ wait_millisecs(int millisecs) wait_period = rem; } +#endif + /* Returns true if prints estimate of duration to ready */ bool check_for_lu_becoming(struct sg_pt_base * ptvp) |