]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Include gethrxtime.h.
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 21 Feb 2005 08:15:45 +0000 (08:15 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 21 Feb 2005 08:15:45 +0000 (08:15 +0000)
(isaac_seed): Use gethrxtime rather than a mishmash.

src/shred.c

index b84a75f12750439ad9c1dd889d6b0352544ee9a8..fc02f134098097248afe159595fd19eb85a92343 100644 (file)
@@ -27,9 +27,6 @@
   - Add -i/--interactive
   - Reserve -d
   - Add -L
-  - Deal with the amazing variety of gettimeofday() implementation bugs.
-    (Some systems use a one-arg form; still others insist that the timezone
-    either be NULL or be non-NULL.  Whee.)
   - Add an unlink-all option to emulate rm.
  */
 
 #include "xstrtol.h"
 #include "dirname.h"
 #include "error.h"
+#include "gethrxtime.h"
 #include "getpagesize.h"
 #include "human.h"
 #include "inttostr.h"
@@ -587,20 +585,7 @@ isaac_seed (struct isaac_state *s)
   { gid_t t = getgid ();   ISAAC_SEED (s, t); }
 
   {
-#if 0 && HAVE_GETHRTIME
-    /* This block if if-0'd out for now because it makes shred
-       fail with an `illegal instruction' when compiled with Sun's
-       c89 on Solaris 8 and 9.  */
-    hrtime_t t = gethrtime ();
-#elif HAVE_CLOCK_GETTIME               /* POSIX ns-resolution */
-    struct timespec t;
-    clock_gettime (CLOCK_REALTIME, &t);
-#elif HAVE_GETTIMEOFDAY
-    struct timeval t;
-    gettimeofday (&t, (struct timezone *) 0);
-#else
-    time_t t = time (NULL);
-#endif
+    xtime_t t = gethrxtime ();
     ISAAC_SEED (s, t);
   }