summaryrefslogtreecommitdiff
path: root/source3/modules
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-01-29 10:59:14 +0100
committerVolker Lendecke <vlendec@samba.org>2011-02-01 22:37:35 +0100
commitba4ec70529c0fa9cf4dc797176dbae1a2c949dbc (patch)
tree0a5f07bc7ca1906086ef256c457c34ecde18b3dd /source3/modules
parent3b948008ce4083ab551257c18659d5ff912990bd (diff)
downloadsamba-ba4ec70529c0fa9cf4dc797176dbae1a2c949dbc.tar.gz
samba-ba4ec70529c0fa9cf4dc797176dbae1a2c949dbc.tar.bz2
samba-ba4ec70529c0fa9cf4dc797176dbae1a2c949dbc.zip
s3: Fix bug 7940 -- fall back for utimes calls
There are systems where ./configure has detected advanced utimes calls which are then not available on other kernels. We should do a proper fallback. Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Tue Feb 1 22:37:35 CET 2011 on sn-devel-104
Diffstat (limited to 'source3/modules')
-rw-r--r--source3/modules/vfs_default.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 9cca349413..698e745d59 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -786,7 +786,11 @@ static int vfswrap_ntimes(vfs_handle_struct *handle,
} else {
result = utimensat(AT_FDCWD, smb_fname->base_name, NULL, 0);
}
-#elif defined(HAVE_UTIMES)
+ if (!((result == -1) && (errno == ENOSYS))) {
+ goto out;
+ }
+#endif
+#if defined(HAVE_UTIMES)
if (ft != NULL) {
struct timeval tv[2];
tv[0] = convert_timespec_to_timeval(ft->atime);
@@ -795,7 +799,11 @@ static int vfswrap_ntimes(vfs_handle_struct *handle,
} else {
result = utimes(smb_fname->base_name, NULL);
}
-#elif defined(HAVE_UTIME)
+ if (!((result == -1) && (errno == ENOSYS))) {
+ goto out;
+ }
+#endif
+#if defined(HAVE_UTIME)
if (ft != NULL) {
struct utimbuf times;
times.actime = convert_timespec_to_time_t(ft->atime);
@@ -804,10 +812,12 @@ static int vfswrap_ntimes(vfs_handle_struct *handle,
} else {
result = utime(smb_fname->base_name, NULL);
}
-#else
+ if (!((result == -1) && (errno == ENOSYS))) {
+ goto out;
+ }
+#endif
errno = ENOSYS;
result = -1;
-#endif
out:
END_PROFILE(syscall_ntimes);