diff options
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/system.c | 9 | ||||
-rw-r--r-- | source3/lib/time.c | 21 |
2 files changed, 10 insertions, 20 deletions
diff --git a/source3/lib/system.c b/source3/lib/system.c index fe8e8004d0..1486600339 100644 --- a/source3/lib/system.c +++ b/source3/lib/system.c @@ -194,6 +194,15 @@ now for utime() ********************************************************************/ int sys_utime(char *fname,struct utimbuf *times) { + /* if the modtime is 0 or -1 then ignore the call and + return success */ + if (times->modtime == (time_t)0 || times->modtime == (time_t)-1) + return 0; + + /* if the access time is 0 or -1 then set it to the modtime */ + if (times->actime == (time_t)0 || times->actime == (time_t)-1) + times->actime = times->modtime; + return(utime(dos_to_unix(fname,False),times)); } diff --git a/source3/lib/time.c b/source3/lib/time.c index 4f688d2214..ad6b04484c 100644 --- a/source3/lib/time.c +++ b/source3/lib/time.c @@ -298,7 +298,7 @@ void put_long_date(char *p,time_t t) /**************************************************************************** check if it's a null mtime ****************************************************************************/ -static BOOL null_mtime(time_t mtime) +BOOL null_mtime(time_t mtime) { if (mtime == 0 || mtime == 0xFFFFFFFF || mtime == (time_t)-1) return(True); @@ -446,25 +446,6 @@ time_t make_unix_date3(void *date_ptr) } /**************************************************************************** -set the time on a file -****************************************************************************/ -BOOL set_filetime(char *fname,time_t mtime) -{ - struct utimbuf times; - - if (null_mtime(mtime)) return(True); - - times.modtime = times.actime = mtime; - - if (sys_utime(fname,×)) { - DEBUG(4,("set_filetime(%s) failed: %s\n",fname,strerror(errno))); - } - - return(True); -} - - -/**************************************************************************** return the date and time as a string ****************************************************************************/ char *timestring(void ) |