aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2011-10-13 11:12:15 +0200
committerTobias Brunner <tobias@strongswan.org>2011-10-13 11:22:40 +0200
commit4a4cf41b9a51a04886d555aff46a608fef1fe0a3 (patch)
treec4982b1d08ade9207a57d396171757ad6f0c6ecd
parent5051bd23eb81c8ac53a0966badcd6a02479f3601 (diff)
downloadstrongswan-4a4cf41b9a51a04886d555aff46a608fef1fe0a3.tar.bz2
strongswan-4a4cf41b9a51a04886d555aff46a608fef1fe0a3.tar.xz
Make sure /proc/$$/fd exists.
This avoids the error message generated by enumerator_create_directory().
-rw-r--r--src/libstrongswan/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstrongswan/utils.c b/src/libstrongswan/utils.c
index 7ad948f70..043330ce3 100644
--- a/src/libstrongswan/utils.c
+++ b/src/libstrongswan/utils.c
@@ -205,7 +205,7 @@ void closefrom(int lowfd)
/* try to close only open file descriptors on Linux... */
len = snprintf(fd_dir, sizeof(fd_dir), "/proc/%u/fd", getpid());
- if (len > 0 && len < sizeof(fd_dir))
+ if (len > 0 && len < sizeof(fd_dir) && access(fd_dir, F_OK) == 0)
{
enumerator_t *enumerator = enumerator_create_directory(fd_dir);
if (enumerator)