--- tail.c Thu Apr 11 21:05:28 2002 +++ tail.c.NEW Thu Apr 11 21:06:39 2002 @@ -170,8 +170,8 @@ /* The number of seconds to sleep between iterations. During one iteration, every file name or descriptor is checked to see if it has changed. */ -/* FIXME: allow fractional seconds */ -static unsigned int sleep_interval = 1; +/* sleep interval defaults to 1,000,000 microseconds */ +static unsigned long sleep_interval = 1000000; /* The process ID of the process (presumably on the current host) that is writing to all followed files. */ @@ -921,7 +921,7 @@ { if (writer_is_dead) break; - sleep (sleep_interval); + usleep (sleep_interval); /* Once the writer is dead, read the files once more to avoid a race condition. */ @@ -1408,14 +1408,14 @@ case 's': { strtol_error s_err; - unsigned long int tmp_ulong; - s_err = xstrtoul (optarg, NULL, 10, &tmp_ulong, ""); - if (s_err != LONGINT_OK || tmp_ulong > UINT_MAX) + double tmp_d; + s_err = xstrtod (optarg, NULL, &tmp_d); + if (s_err != LONGINT_OK || (unsigned long) (tmp_d*1000000.0) > UINT_MAX) { error (EXIT_FAILURE, 0, _("%s: invalid number of seconds"), optarg); } - sleep_interval = tmp_ulong; + sleep_interval = (unsigned long) (tmp_d*1000000.0); } break;