From 18404ac45271f8b0043652033e49236af4f62742 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Wed, 23 Dec 2009 15:08:04 +0000 Subject: booster/fcntl: implement F_GETFD and F_SETFD. Signed-off-by: Raghavendra G Signed-off-by: Anand V. Avati BUG: 446 (apache does not start in daemon mode on fedora core 11.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=446 --- booster/src/booster.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'booster/src/booster.c') diff --git a/booster/src/booster.c b/booster/src/booster.c index 00352d621..b939b771c 100644 --- a/booster/src/booster.c +++ b/booster/src/booster.c @@ -2598,6 +2598,19 @@ fcntl (int fd, int cmd, ...) */ /* case F_DUPFD_CLOEXEC: */ case F_GETFD: + if (glfs_fd != NULL) { + ret = booster_get_close_on_exec (booster_fdtable, fd) + ? FD_CLOEXEC : 0; + } else { + if (real_fcntl == NULL) { + ret = -1; + errno = ENOSYS; + } else { + ret = real_fcntl (fd, cmd); + } + } + break; + case F_GETFL: case F_GETOWN: case F_GETSIG: @@ -2617,6 +2630,19 @@ fcntl (int fd, int cmd, ...) break; case F_SETFD: + if (glfs_fd != NULL) { + booster_set_close_on_exec (booster_fdtable, fd); + ret = 0; + } else { + if (real_fcntl == NULL) { + ret = -1; + errno = ENOSYS; + } else { + ret = real_fcntl (fd, cmd); + } + } + break; + case F_SETFL: case F_SETOWN: case F_SETSIG: -- cgit