smbd: remove errno saving from fd_open()
authorRalph Boehme <slow@samba.org>
Wed, 15 Jul 2020 10:01:18 +0000 (12:01 +0200)
committerJeremy Allison <jra@samba.org>
Sat, 18 Jul 2020 05:58:41 +0000 (05:58 +0000)
This is not needed anymore since 97d061237b0f2e07ae9c8e893734e222e58cfa4e.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/open.c

index 767d3fefddb3889fefa357d249ea3c9996038199..545c19b4d6ca7e211879252c1796e9dfb982cb8e 100644 (file)
@@ -779,7 +779,6 @@ NTSTATUS fd_open(files_struct *fsp,
        struct connection_struct *conn = fsp->conn;
        struct smb_filename *smb_fname = fsp->fsp_name;
        NTSTATUS status = NT_STATUS_OK;
-       int saved_errno = 0;
 
        /*
         * Never follow symlinks on a POSIX client. The
@@ -799,13 +798,6 @@ NTSTATUS fd_open(files_struct *fsp,
                                        flags,
                                        mode,
                                        0);
-       if (fsp->fh->fd == -1) {
-               saved_errno = errno;
-       }
-       if (saved_errno != 0) {
-               errno = saved_errno;
-       }
-
        if (fsp->fh->fd == -1) {
                int posix_errno = link_errno_convert(errno);
                status = map_nt_error_from_unix(posix_errno);