From: Volker Lendecke Date: Mon, 3 Feb 2025 17:33:46 +0000 (+0100) Subject: lib: Simplify ad_get_internal() X-Git-Tag: tdb-1.4.13~31 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2a6209966df861844ac26cd13311abc88dddae3f;p=thirdparty%2Fsamba.git lib: Simplify ad_get_internal() Remove an unnecessary variable Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/lib/adouble.c b/source3/lib/adouble.c index 71efa4a6a9f..8a5b94922cd 100644 --- a/source3/lib/adouble.c +++ b/source3/lib/adouble.c @@ -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",