@@ -200,7 +200,7 @@ static char opt_vendor[16] = "";
200200static char opt_location [32 ] = "" ; /* Hub location a-b.c.d */
201201static int opt_ports = ALL_HUB_PORTS ; /* Bitmask of ports to operate on */
202202static int opt_action = POWER_KEEP ;
203- static int opt_delay = 2 ;
203+ static double opt_delay = 2 ;
204204static int opt_repeat = 1 ;
205205static int opt_wait = 20 ; /* wait before repeating in ms */
206206static int opt_exact = 0 ; /* exact location match - disable USB3 duality handling */
@@ -234,7 +234,7 @@ static int print_usage()
234234 "--ports, -p - ports to operate on [all hub ports].\n"
235235 "--loc, -l - limit hub by location [all smart hubs].\n"
236236 "--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"
238238 "--repeat, -r - repeat power off count [%d] (some devices need it to turn off).\n"
239239 "--exact, -e - exact location (no USB3 duality handling).\n"
240240 "--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[])
796796 }
797797 break ;
798798 case 'd' :
799- opt_delay = atoi (optarg );
799+ opt_delay = atof (optarg );
800800 break ;
801801 case 'r' :
802802 opt_repeat = atoi (optarg );
@@ -962,7 +962,7 @@ int main(int argc, char *argv[])
962962 libusb_close (devh );
963963 }
964964 if (k == 0 && opt_action == POWER_CYCLE )
965- sleep_ms (opt_delay * 1000 );
965+ sleep_ms (( int )( opt_delay * 1000 ) );
966966 }
967967 rc = 0 ;
968968cleanup :
0 commit comments