@@ -200,7 +200,7 @@ static char opt_vendor[16] = "";
200
200
static char opt_location [32 ] = "" ; /* Hub location a-b.c.d */
201
201
static int opt_ports = ALL_HUB_PORTS ; /* Bitmask of ports to operate on */
202
202
static int opt_action = POWER_KEEP ;
203
- static int opt_delay = 2 ;
203
+ static double opt_delay = 2 ;
204
204
static int opt_repeat = 1 ;
205
205
static int opt_wait = 20 ; /* wait before repeating in ms */
206
206
static int opt_exact = 0 ; /* exact location match - disable USB3 duality handling */
@@ -234,7 +234,7 @@ static int print_usage()
234
234
"--ports, -p - ports to operate on [all hub ports].\n"
235
235
"--loc, -l - limit hub by location [all smart hubs].\n"
236
236
"--vendor, -n - limit hub by vendor id [%s] (partial ok).\n"
237
- "--delay, -d - delay for cycle action [%d sec].\n"
237
+ "--delay, -d - delay for cycle action [%g sec].\n"
238
238
"--repeat, -r - repeat power off count [%d] (some devices need it to turn off).\n"
239
239
"--exact, -e - exact location (no USB3 duality handling).\n"
240
240
"--reset, -R - reset hub after each power-on action, causing all devices to reassociate.\n"
@@ -796,7 +796,7 @@ int main(int argc, char *argv[])
796
796
}
797
797
break ;
798
798
case 'd' :
799
- opt_delay = atoi (optarg );
799
+ opt_delay = atof (optarg );
800
800
break ;
801
801
case 'r' :
802
802
opt_repeat = atoi (optarg );
@@ -962,7 +962,7 @@ int main(int argc, char *argv[])
962
962
libusb_close (devh );
963
963
}
964
964
if (k == 0 && opt_action == POWER_CYCLE )
965
- sleep_ms (opt_delay * 1000 );
965
+ sleep_ms (( int )( opt_delay * 1000 ) );
966
966
}
967
967
rc = 0 ;
968
968
cleanup :
0 commit comments