summaryrefslogtreecommitdiff
path: root/source/lib
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1997-10-20 18:52:04 +0000
committerJeremy Allison <jra@samba.org>1997-10-20 18:52:04 +0000
commit41a1d81c112a82ad2ae1b3c4ee81051f133ce1ed (patch)
treec2d67e7f8d38f24d09c5166a8403d22dc1e10709 /source/lib
parentc6e37d8db0cd89a84a54a0cedfeacf50fb3f7a4c (diff)
downloadsamba-41a1d81c112a82ad2ae1b3c4ee81051f133ce1ed.tar.gz
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)
Diffstat (limited to 'source/lib')
-rw-r--r--source/lib/system.c9
-rw-r--r--source/lib/time.c21
2 files changed, 10 insertions, 20 deletions
diff --git a/source/lib/system.c b/source/lib/system.c
index fe8e8004d04..1486600339a 100644
--- a/source/lib/system.c
+++ b/source/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/source/lib/time.c b/source/lib/time.c
index 4f688d2214a..ad6b04484c5 100644
--- a/source/lib/time.c
+++ b/source/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,&times)) {
- DEBUG(4,("set_filetime(%s) failed: %s\n",fname,strerror(errno)));
- }
-
- return(True);
-}
-
-
-/****************************************************************************
return the date and time as a string
****************************************************************************/
char *timestring(void )