From: Stefan Metzmacher Date: Fri, 18 Dec 2020 13:03:09 +0000 (+0100) Subject: s3:smbd: add vfs_fake_fd_close() helper X-Git-Tag: samba-4.14.0rc1~138 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f057333466b2d9845cd8bc2b794d98252ade2a4;p=thirdparty%2Fsamba.git s3:smbd: add vfs_fake_fd_close() helper 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 Reviewed-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index 6c287900802..7d6f8eda607 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -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 */ diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index c2bf9e92f31..26446c3505a 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -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 */