summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-04-04 18:55:09 +0000
committerJeremy Allison <jra@samba.org>2000-04-04 18:55:09 +0000
commit0dfb016020caea5cd0b6b88cc49ab3a62114a9a6 (patch)
treea964b5a6aa73ae372f8ef39d46af0af67d6c8010
parent98b6ec334dd04c04aa4ae43e15e86da5d1da7baa (diff)
downloadsamba-0dfb016020caea5cd0b6b88cc49ab3a62114a9a6.tar.gz
vfs change. POSIX states fsync must return an int, not void.
Jeremy.
-rw-r--r--source/include/proto.h2
-rw-r--r--source/include/vfs.h2
-rw-r--r--source/smbd/fileio.c2
-rw-r--r--source/smbd/vfs-wrap.c6
4 files changed, 6 insertions, 6 deletions
diff --git a/source/include/proto.h b/source/include/proto.h
index 30fafe79953..04edcef28c4 100644
--- a/source/include/proto.h
+++ b/source/include/proto.h
@@ -4854,7 +4854,7 @@ ssize_t vfswrap_read(int fd, char *data, size_t n);
ssize_t vfswrap_write(int fd, char *data, size_t n);
SMB_OFF_T vfswrap_lseek(int filedes, SMB_OFF_T offset, int whence);
int vfswrap_rename(char *old, char *new);
-void vfswrap_fsync(int fd);
+int vfswrap_fsync(int fd);
int vfswrap_stat(char *fname, SMB_STRUCT_STAT *sbuf);
int vfswrap_fstat(int fd, SMB_STRUCT_STAT *sbuf);
int vfswrap_lstat(char *path,
diff --git a/source/include/vfs.h b/source/include/vfs.h
index 885e7d486b2..fca9f7da84a 100644
--- a/source/include/vfs.h
+++ b/source/include/vfs.h
@@ -129,7 +129,7 @@ struct vfs_ops {
ssize_t (*write)(int fd, char *data, size_t n);
SMB_OFF_T (*lseek)(int filedes, SMB_OFF_T offset, int whence);
int (*rename)(char *old, char *new);
- void (*fsync)(int fd);
+ int (*fsync)(int fd);
int (*stat)(char *fname, SMB_STRUCT_STAT *sbuf);
int (*fstat)(int fd, SMB_STRUCT_STAT *sbuf);
int (*lstat)(char *path, SMB_STRUCT_STAT *sbuf);
diff --git a/source/smbd/fileio.c b/source/smbd/fileio.c
index 7a96e6e598c..b6d19cb94fb 100644
--- a/source/smbd/fileio.c
+++ b/source/smbd/fileio.c
@@ -651,10 +651,8 @@ sync a file
void sys_fsync_file(connection_struct *conn, files_struct *fsp)
{
-#ifdef HAVE_FSYNC
if(lp_strict_sync(SNUM(conn)) && fsp->fd_ptr != NULL) {
flush_write_cache(fsp, SYNC_FLUSH);
conn->vfs_ops.fsync(fsp->fd_ptr->fd);
}
-#endif
}
diff --git a/source/smbd/vfs-wrap.c b/source/smbd/vfs-wrap.c
index 24e45a6d24a..8d330e62b67 100644
--- a/source/smbd/vfs-wrap.c
+++ b/source/smbd/vfs-wrap.c
@@ -204,9 +204,11 @@ int vfswrap_rename(char *old, char *new)
return result;
}
-void vfswrap_fsync(int fd)
+int vfswrap_fsync(int fd)
{
- fsync(fd);
+#ifdef HAVE_FSYNC
+ return fsync(fd);
+#endif
}
int vfswrap_stat(char *fname, SMB_STRUCT_STAT *sbuf)