]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_ceph{_new}: do not set errno upon successful call to libcephfs
authorShachar Sharon <ssharon@redhat.com>
Tue, 30 Jul 2024 06:55:44 +0000 (09:55 +0300)
committerGünther Deschner <gd@samba.org>
Wed, 7 Aug 2024 13:02:34 +0000 (13:02 +0000)
There is code in Samba that expects errno from a previous system call
to be preserved through a subsequent system call. Thus, avoid setting
"errno = 0" in status_code() and lstatus_code() upon successful return
from libcephfs API call.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15686

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
source3/modules/vfs_ceph.c
source3/modules/vfs_ceph_new.c

index 1dd136e569b1f50ab8071a382e187446c0a00efe..fd450af16c26c3cb56d7e5efa4efc7625ef0fa67 100644 (file)
@@ -66,7 +66,6 @@ static inline int status_code(int ret)
                errno = -ret;
                return -1;
        }
-       errno = 0;
        return ret;
 }
 
@@ -76,7 +75,6 @@ static inline ssize_t lstatus_code(intmax_t ret)
                errno = -((int)ret);
                return -1;
        }
-       errno = 0;
        return (ssize_t)ret;
 }
 
index 99d4a1fe40749523ae64d10ddab58d9636963682..c11f5f2461654198acb5e850f90d1545dd499909 100644 (file)
@@ -66,7 +66,6 @@ static int status_code(int ret)
                errno = -ret;
                return -1;
        }
-       errno = 0;
        return ret;
 }
 
@@ -76,7 +75,6 @@ static ssize_t lstatus_code(intmax_t ret)
                errno = -((int)ret);
                return -1;
        }
-       errno = 0;
        return (ssize_t)ret;
 }