]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib: Simplify ad_get_internal()
authorVolker Lendecke <vl@samba.org>
Mon, 3 Feb 2025 17:33:46 +0000 (18:33 +0100)
committerJeremy Allison <jra@samba.org>
Wed, 5 Feb 2025 00:07:30 +0000 (00:07 +0000)
Remove an unnecessary variable

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/lib/adouble.c

index 71efa4a6a9f416cd46c405511937c76e5c029ddc..8a5b94922cd6f05e6722845c46091f82a3ed25c5 100644 (file)
@@ -2581,7 +2581,6 @@ static struct adouble *ad_get_internal(TALLOC_CTX *ctx,
        int rc = 0;
        ssize_t len;
        struct adouble *ad = NULL;
-       int mode;
 
        if (fsp != NULL) {
                struct files_struct *meta_fsp = metadata_fsp(fsp);
@@ -2599,12 +2598,9 @@ static struct adouble *ad_get_internal(TALLOC_CTX *ctx,
        }
 
        /* Try rw first so we can use the fd in ad_convert() */
-       mode = O_RDWR;
-
-       rc = ad_open(handle, ad, fsp, smb_fname, mode, 0);
+       rc = ad_open(handle, ad, fsp, smb_fname, O_RDWR, 0);
        if (rc == -1 && ((errno == EROFS) || (errno == EACCES))) {
-               mode = O_RDONLY;
-               rc = ad_open(handle, ad, fsp, smb_fname, mode, 0);
+               rc = ad_open(handle, ad, fsp, smb_fname, O_RDONLY, 0);
        }
        if (rc == -1) {
                DBG_DEBUG("ad_open [%s] error [%s]\n",