GlusterFS currently doesn't have an API implementation to set flags on
open file descriptor. Thus we use pipe() to provide valid file descriptor
from the system.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14241
Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Fri Jan 17 17:14:43 UTC 2020 on sn-devel-184
{
glfs_fd_t *glfd;
glfs_fd_t **p_tmp;
+ int fakefd[2];
START_PROFILE(syscall_open);
*p_tmp = glfd;
END_PROFILE(syscall_open);
- /* An arbitrary value for error reporting, so you know its us. */
- return 13371337;
+
+ if (pipe(fakefd) == -1) {
+ DBG_ERR("pipe failed: %s\n", strerror(errno));
+ return -1;
+ }
+
+ close(fakefd[1]);
+
+ return fakefd[0];
}
static int vfs_gluster_close(struct vfs_handle_struct *handle,
return -1;
}
+ close(fsp->fh->fd);
+
VFS_REMOVE_FSP_EXTENSION(handle, fsp);
ret = glfs_close(glfd);