diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2013-04-22 07:21:53 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2013-04-22 07:21:53 +0000 |
commit | ee80d2996911906488b37d59e29889abbfea129a (patch) | |
tree | 49c6cd34c5d29613aafd83d1c8c3f926fc7a65cf /usr.bin | |
parent | 8112f41f7cd28597df1205320af255e5d90af551 (diff) |
unifdef non full TIMESPEC code
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/make/timestamp.c | 14 | ||||
-rw-r--r-- | usr.bin/make/timestamp.h | 22 | ||||
-rw-r--r-- | usr.bin/make/timestamp_t.h | 7 |
3 files changed, 3 insertions, 40 deletions
diff --git a/usr.bin/make/timestamp.c b/usr.bin/make/timestamp.c index 6617a902878..116d175b9c8 100644 --- a/usr.bin/make/timestamp.c +++ b/usr.bin/make/timestamp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: timestamp.c,v 1.7 2011/12/10 04:12:36 guenther Exp $ */ +/* $OpenBSD: timestamp.c,v 1.8 2013/04/22 07:21:52 espie Exp $ */ /* * Copyright (c) 2001 Marc Espie. @@ -28,25 +28,13 @@ #include "defines.h" #include "timestamp.h" -#ifndef USE_TIMESPEC -#include <sys/types.h> -#include <utime.h> -#endif TIMESTAMP now; /* The time at the start of this whole process */ int set_times(const char *f) { -#ifdef USE_TIMESPEC return utimes(f, NULL); -#else - struct utimbuf times; - - time(×.actime); - times.modtime = times.actime; - return utime(f, ×); -#endif } char * diff --git a/usr.bin/make/timestamp.h b/usr.bin/make/timestamp.h index 1ff95e5acd4..5033b8b5bc8 100644 --- a/usr.bin/make/timestamp.h +++ b/usr.bin/make/timestamp.h @@ -1,7 +1,7 @@ #ifndef TIMESTAMP_H #define TIMESTAMP_H -/* $OpenBSD: timestamp.h,v 1.7 2011/12/10 04:12:36 guenther Exp $ */ +/* $OpenBSD: timestamp.h,v 1.8 2013/04/22 07:21:52 espie Exp $ */ /* * Copyright (c) 2001 Marc Espie. @@ -51,7 +51,6 @@ #ifndef TIMESTAMP_TYPE #include "timestamp_t.h" #endif -#ifdef USE_TIMESPEC #define ts_set_out_of_date(t) (t).tv_sec = INT_MIN, (t).tv_nsec = 0 #define is_out_of_date(t) ((t).tv_sec == INT_MIN && (t).tv_nsec == 0) #define ts_set_from_stat(s, t) \ @@ -71,25 +70,6 @@ do { \ } while (0) #define ts_set_from_now(n) clock_gettime(CLOCK_REALTIME, &(n)) #define timestamp2time_t(t) ((t).tv_sec) -#else -#define is_out_of_date(t) ((t) == INT_MIN) -#define ts_set_out_of_date(t) (t) = INT_MIN -#define ts_set_from_stat(s, t) \ -do { \ - (t) = (s).st_mtime; \ - if (is_out_of_date(t)) \ - (t)++; \ -} while (0) -#define is_strictly_before(t1, t2) ((t1) < (t2)) -#define ts_set_from_time_t(d, t) \ -do { \ - (t) = d; \ - if (is_out_of_date(t)) \ - (t)++; \ -} while (0) -#define ts_set_from_now(n) time(&(n)) -#define timestamp2time_t(t) (t) -#endif extern int set_times(const char *); diff --git a/usr.bin/make/timestamp_t.h b/usr.bin/make/timestamp_t.h index 4e70a8deb51..819600b19eb 100644 --- a/usr.bin/make/timestamp_t.h +++ b/usr.bin/make/timestamp_t.h @@ -1,4 +1,4 @@ -/* $OpenBSD: timestamp_t.h,v 1.3 2010/07/19 19:46:44 espie Exp $ */ +/* $OpenBSD: timestamp_t.h,v 1.4 2013/04/22 07:21:52 espie Exp $ */ /* * Copyright (c) 2001 Marc Espie. @@ -25,12 +25,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef USE_TIMESPEC #include <sys/time.h> typedef struct timespec TIMESTAMP; -#else -#include <time.h> -typedef time_t TIMESTAMP; -#endif #define TIMESTAMP_TYPE |