diff options
author | Jeremy Allison <jra@samba.org> | 1997-10-20 18:52:04 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1997-10-20 18:52:04 +0000 |
commit | 79f4fb52c1ed56fd843f81b4eb0cdd2991d4d0f4 (patch) | |
tree | 2011e0c8045a90593bc71f0e802eed91e4c82ffb /source3/lib | |
parent | 77a93855259fe29c8b37575aba5f07dbb70d3510 (diff) | |
download | samba-79f4fb52c1ed56fd843f81b4eb0cdd2991d4d0f4.tar.gz samba-79f4fb52c1ed56fd843f81b4eb0cdd2991d4d0f4.tar.xz samba-79f4fb52c1ed56fd843f81b4eb0cdd2991d4d0f4.zip |
loadparm.c: Changed 'interfaces only' parameter to 'bind interfaces only'. Added
'dos filetimes' parameter for UTIME fix.
locking_shm.c: Fixed typo (sorry Andrew :-).
namepacket.c: Changed lp_interfaces_only() to lp_bind_interfaces_only().
proto.h: The usual.
reply.c: Made filetime calls use new file_utime call (wrapper for sys_utime).
server.c: Made filetime calls use new file_utime call (wrapper for sys_utime).
system.c: Added Andrew's sanity checks to times in sys_utime().
time.c: Moved set_filetime() to server.c. Made null_mtime() global.
trans2.c: Made filetime calls use new file_utime call (wrapper for sys_utime).
Jeremy (jallison@whistle.com)
(This used to be commit 41a1d81c112a82ad2ae1b3c4ee81051f133ce1ed)
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 fe8e8004d04..1486600339a 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 4f688d2214a..ad6b04484c5 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 ) |