summaryrefslogtreecommitdiffstats
path: root/source/libsmb/libsmb_compat.c
diff options
context:
space:
mode:
authorDerrell Lipman <derrell@samba.org>2005-06-01 17:40:40 +0000
committerDerrell Lipman <derrell@samba.org>2005-06-01 17:40:40 +0000
commitec91592e5feef079e3a73cfe4b51b8f8de998e05 (patch)
treef47132c80bc322db052185c3dbf2405a8bbcb607 /source/libsmb/libsmb_compat.c
parent15b8d90258d054fcf77fb37b1198d344216505e2 (diff)
downloadsamba-ec91592e5feef079e3a73cfe4b51b8f8de998e05.tar.gz
samba-ec91592e5feef079e3a73cfe4b51b8f8de998e05.tar.xz
samba-ec91592e5feef079e3a73cfe4b51b8f8de998e05.zip
r7168: Updating file times from libsmbclient was not working for win98. Although
the function that was being used to set attributes is a core protocol function (SMBsetatr = 0x09), it does not appear to work on win98. As a temporary measure, when file times are to be set, this version opens the file and uses SMBsetattrE = 0x22 instead. (The other advantage of this function over the original one is that it supports setting access time as well as modification time.) The next step, the proper solution if it can be made to work, is to write functions that use TRANS2_SET_PATH_INFO instead.
Diffstat (limited to 'source/libsmb/libsmb_compat.c')
-rw-r--r--source/libsmb/libsmb_compat.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source/libsmb/libsmb_compat.c b/source/libsmb/libsmb_compat.c
index 83088a14def..3dc60f7240b 100644
--- a/source/libsmb/libsmb_compat.c
+++ b/source/libsmb/libsmb_compat.c
@@ -303,14 +303,16 @@ int smbc_utimes(const char *fname, struct timeval *tbuf)
#ifdef HAVE_UTIME_H
int smbc_utime(const char *fname, struct utimbuf *utbuf)
{
- struct timeval tv;
+ struct timeval tv[2];
if (utbuf == NULL)
return statcont->utimes(statcont, fname, NULL);
- tv.tv_sec = utbuf->modtime;
- tv.tv_usec = 0;
- return statcont->utimes(statcont, fname, &tv);
+ tv[0].tv_sec = utbuf->actime;
+ tv[1].tv_sec = utbuf->modtime;
+ tv[0].tv_usec = tv[1].tv_usec = 0;
+
+ return statcont->utimes(statcont, fname, tv);
}
#endif