summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_fruit.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/modules/vfs_fruit.c')
-rw-r--r--source3/modules/vfs_fruit.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c
index 0441d5ebd48..dd404909847 100644
--- a/source3/modules/vfs_fruit.c
+++ b/source3/modules/vfs_fruit.c
@@ -755,11 +755,14 @@ static ssize_t ad_header_read_rsrc(struct adouble *ad, const char *path)
struct adouble *meta_ad = NULL;
SMB_STRUCT_STAT sbuf;
bool ok;
- int saved_errno;
+ int saved_errno = 0;
SMB_VFS_HANDLE_GET_DATA(ad->ad_handle, config,
struct fruit_config_data, return -1);
+ /* Try rw first so we can use the fd in ad_convert() */
+ mode = O_RDWR;
+
if (ad->ad_fsp && ad->ad_fsp->fh && (ad->ad_fsp->fh->fd != -1)) {
fd = ad->ad_fsp->fh->fd;
} else {
@@ -772,9 +775,6 @@ static ssize_t ad_header_read_rsrc(struct adouble *ad, const char *path)
}
}
- /* Try rw first so we can use the fd in ad_convert() */
- mode = O_RDWR;
-
retry:
if (config->rsrc == FRUIT_RSRC_XATTR) {
#ifndef HAVE_ATTROPEN