From e42198b7c85f6b707c9dab4de2bba81f089b3b33 Mon Sep 17 00:00:00 2001 From: axel Date: Thu, 22 Jun 2006 00:15:44 +1000 Subject: [PATCH] Implement fallback version of futimes instead of testing for it's existance in reader.c darcs-hash:20060621141544-ac50b-4726e3f63644b64b8bbb5cd829383c1fc6f8d86e.gz --- fallback.c | 12 ++++++++++++ fallback.h | 7 +++++++ reader.c | 7 +++++-- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/fallback.c b/fallback.c index 1ed4a477b..95889ede1 100644 --- a/fallback.c +++ b/fallback.c @@ -1020,3 +1020,15 @@ int srand48_r(long int seedval, struct drand48_data *buffer) } #endif + +#ifndef HAVE_FUTIMES + +int futimes(int fd, const struct timeval *times) +{ + errno = ENOSYS; + return -1; +} + + +#endif + diff --git a/fallback.h b/fallback.h index ea3259bc8..066539622 100644 --- a/fallback.h +++ b/fallback.h @@ -8,6 +8,7 @@ #include #include #include +#include #ifndef WCHAR_MAX /** @@ -318,5 +319,11 @@ int srand48_r(long int seedval, struct drand48_data *buffer); #endif +#ifndef HAVE_FUTIMES + +int futimes(int fd, const struct timeval *times); + +#endif + #endif diff --git a/reader.c b/reader.c index b39b44426..776a8a361 100644 --- a/reader.c +++ b/reader.c @@ -962,7 +962,6 @@ static void check_colors() static void reader_save_status() { -#ifdef HAVE_FUTIMES /* This futimes call tries to trick the system into using st_mtime as a tampering flag. This of course only works on systems where @@ -983,9 +982,13 @@ static void reader_save_status() } ; + /* + Don't check return value on these. We don't care if they fail, + really. This is all just to make the prompt look ok, which is + impossible to do 100% reliably. We try, at least. + */ futimes( 1, t ); futimes( 2, t ); -#endif fstat( 1, &prev_buff_1 ); fstat( 2, &prev_buff_2 );