diff options
| author | Greg Banks <gnb@melbourne.sgi.com> | 2006-07-03 14:21:48 +1000 |
|---|---|---|
| committer | Greg Banks <gnb@melbourne.sgi.com> | 2006-07-03 14:21:48 +1000 |
| commit | 940c7c304d4a43c00c27529cdddc7c87db6eef87 (patch) | |
| tree | b2d1f4d190afd1c21e8e31eada9d6e58cfa0f93b /utils/idmapd/idmapd.c | |
| parent | b90d201551aaa712c011c3d5de900fad714a26a6 (diff) | |
| parent | a503848d423fe1681879936da7b526b15f7eca23 (diff) | |
| download | nfs-utils-940c7c304d4a43c00c27529cdddc7c87db6eef87.tar.gz nfs-utils-940c7c304d4a43c00c27529cdddc7c87db6eef87.tar.xz nfs-utils-940c7c304d4a43c00c27529cdddc7c87db6eef87.zip | |
Merge branch 'master' of git://linux-nfs.org/nfs-utils
Diffstat (limited to 'utils/idmapd/idmapd.c')
| -rw-r--r-- | utils/idmapd/idmapd.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/utils/idmapd/idmapd.c b/utils/idmapd/idmapd.c index 16b1316..21a1916 100644 --- a/utils/idmapd/idmapd.c +++ b/utils/idmapd/idmapd.c @@ -1006,10 +1006,15 @@ mydaemon(int nochdir, int noclose) if (noclose == 0) { tempfd = open("/dev/null", O_RDWR); - dup2(tempfd, 0); - dup2(tempfd, 1); - dup2(tempfd, 2); - closeall(3); + if (tempfd < 0) + tempfd = open("/", O_RDONLY); + if (tempfd >= 0) { + dup2(tempfd, 0); + dup2(tempfd, 1); + dup2(tempfd, 2); + closeall(3); + } else + closeall(0); } return; |
