]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:smbd: add vfs_fake_fd_close() helper
authorStefan Metzmacher <metze@samba.org>
Fri, 18 Dec 2020 13:03:09 +0000 (14:03 +0100)
committerJeremy Allison <jra@samba.org>
Fri, 8 Jan 2021 20:31:33 +0000 (20:31 +0000)
When we used vfs_fake_fd() we should use vfs_fake_fd_close()
in order to have things symetric.

This makes code easier to understand and may allow us to change
vfs_fake_fd() internally if required.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/proto.h
source3/smbd/vfs.c

index 6c28790080216914d56628a1677685c16aa1b880..7d6f8eda60790efab5f66c36a279986c41deebe9 100644 (file)
@@ -1317,6 +1317,7 @@ NTSTATUS vfs_streaminfo(connection_struct *conn,
                        struct stream_struct **streams);
 void init_smb_file_time(struct smb_file_time *ft);
 int vfs_fake_fd(void);
+int vfs_fake_fd_close(int fd);
 
 /* The following definitions come from smbd/avahi_register.c */
 
index c2bf9e92f31c866f568391984e7cf8e362bd30c5..26446c3505ab07fce914e42679a018137f0366fd 100644 (file)
@@ -1609,6 +1609,15 @@ int vfs_fake_fd(void)
        return pipe_fds[0];
 }
 
+/*
+ * This is just a helper to make
+ * users of vfs_fake_fd() more symetric
+ */
+int vfs_fake_fd_close(int fd)
+{
+       return close(fd);
+}
+
 /*
   generate a file_id from a stat structure
  */