diff options
author | Alexander Bokovoy <ab@samba.org> | 2008-01-17 14:57:35 +0300 |
---|---|---|
committer | Alexander Bokovoy <ab@samba.org> | 2008-01-17 14:57:35 +0300 |
commit | 026a66abecea3e3a54cdbfb97129d5e65608e5df (patch) | |
tree | 549c3c1e1a715a020b4f3b1fa6160f6d2d071269 /source3/modules/vfs_default.c | |
parent | 6de904b836f4fdf5b0b027a09554afe3c13e05ca (diff) | |
download | samba-026a66abecea3e3a54cdbfb97129d5e65608e5df.tar.gz samba-026a66abecea3e3a54cdbfb97129d5e65608e5df.tar.bz2 samba-026a66abecea3e3a54cdbfb97129d5e65608e5df.zip |
Rework of VFS is_offline() function to only return boolean offline/online result for a file.
This makes sense as upper levels are only taking returned result of 0
(no error) into consideration when deciding whether to mark file
offline/online as returned from is_offline.
That means that we simply can move the decision down to VFS module and
clean up upper levels so that they always see only file status. If there
is an error when trying to identify file status, then VFS module could
decide what to return (offline or online) by itself -- after all, it
ought to have system-specific knowledge anyway.
(This used to be commit 75cc08661473cce62756fa062071bb2bc1fb39ec)
Diffstat (limited to 'source3/modules/vfs_default.c')
-rw-r--r-- | source3/modules/vfs_default.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index d4ba4dc611..755bcdeefa 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -1230,22 +1230,20 @@ static bool vfswrap_aio_force(struct vfs_handle_struct *handle, struct files_str return false; } -static int vfswrap_is_offline(struct vfs_handle_struct *handle, const char *path, SMB_STRUCT_STAT *sbuf, bool *offline) +static bool vfswrap_is_offline(struct vfs_handle_struct *handle, const char *path, SMB_STRUCT_STAT *sbuf) { if (ISDOT(path) || ISDOTDOT(path)) { - *offline = false; - return 0; + return false; } if (!lp_dmapi_support(SNUM(handle->conn)) || !dmapi_have_session()) { #if defined(ENOTSUP) errno = ENOTSUP; #endif - return -1; + return false; } - *offline = (dmapi_file_flags(path) & FILE_ATTRIBUTE_OFFLINE) != 0; - return 0; + return (dmapi_file_flags(path) & FILE_ATTRIBUTE_OFFLINE) != 0; } static int vfswrap_set_offline(struct vfs_handle_struct *handle, const char *path) |