diff options
author | Raghavendra G <raghavendra@gluster.com> | 2009-12-23 15:06:38 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-01-23 11:07:09 -0800 |
commit | 899b89a8c2faee55128db392cdb426e08e2289e7 (patch) | |
tree | 737430525813b5bfb517e463ca70cea7f7fb6245 /booster/src/booster.c | |
parent | da505a63c12ea9be0e783711547fe7bbfecf05ea (diff) | |
download | glusterfs-899b89a8c2faee55128db392cdb426e08e2289e7.tar.gz glusterfs-899b89a8c2faee55128db392cdb426e08e2289e7.tar.xz glusterfs-899b89a8c2faee55128db392cdb426e08e2289e7.zip |
booster/fcntl: implement F_GETFD and F_SETFD.v3.0.1rc5
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
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
Diffstat (limited to 'booster/src/booster.c')
-rw-r--r-- | booster/src/booster.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/booster/src/booster.c b/booster/src/booster.c index 450f24c6bf..d767465985 100644 --- a/booster/src/booster.c +++ b/booster/src/booster.c @@ -2692,6 +2692,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: @@ -2711,6 +2724,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: |