X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fgettime.c;h=86bd325091b3bd90be710630971affe8646ca176;hb=fa662f811f9a6dda54f64639b107b1637c3ba2e5;hp=d60711b533516fe3729225310e063dc0b2ec65e1;hpb=14bf04a59fbfa9ae7a9b55f7885ed96a5f0341ac;p=gnulib.git diff --git a/lib/gettime.c b/lib/gettime.c index d60711b53..86bd32509 100644 --- a/lib/gettime.c +++ b/lib/gettime.c @@ -1,5 +1,6 @@ /* gettime -- get the system clock - Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. + + Copyright (C) 2002, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. 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 @@ -17,12 +18,12 @@ /* Written by Paul Eggert. */ -#ifdef HAVE_CONFIG_H -# include -#endif +#include #include "timespec.h" +#include + /* Get the system time into *TS. */ void @@ -37,23 +38,12 @@ gettime (struct timespec *ts) return; # endif -# if HAVE_GETTIMEOFDAY { struct timeval tv; gettimeofday (&tv, NULL); ts->tv_sec = tv.tv_sec; ts->tv_nsec = tv.tv_usec * 1000; } -# else - -# ifndef OK_TO_USE_1S_CLOCK -# error "Only 1-second nominal clock resolution found. Is that intended?" \ - "If so, compile with the -DOK_TO_USE_1S_CLOCK option." -# endif - ts->tv_sec = time (NULL); - ts->tv_nsec = 0; - -# endif #endif }