[Pkg-gnupg-commit] [gnupg2] 35/102: common: Simplify the fd closing patch 512c56a.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Fri Jun 17 00:14:52 UTC 2016


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch experimental
in repository gnupg2.

commit e6d9a2d07ed7aeac3944d8a7d1317c4a117356b4
Author: Werner Koch <wk at gnupg.org>
Date:   Fri May 27 22:22:37 2016 +0200

    common: Simplify the fd closing patch 512c56a.
    
    * common/exechelp-posix.c (get_max_fds): Use /proc/self.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>
---
 common/exechelp-posix.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/common/exechelp-posix.c b/common/exechelp-posix.c
index 81831ee..a7a9a92 100644
--- a/common/exechelp-posix.c
+++ b/common/exechelp-posix.c
@@ -114,14 +114,12 @@ get_max_fds (void)
    * that list before starting to close them.  */
 #ifdef __linux__
   {
-    char dirname[50];
     DIR *dir = NULL;
     struct dirent *dir_entry;
     const char *s;
     int x;
 
-    snprintf (dirname, sizeof dirname, "/proc/%u/fd", (unsigned int)getpid ());
-    dir = opendir (dirname);
+    dir = opendir ("/proc/self/fd");
     if (dir)
       {
         while ((dir_entry = readdir (dir)))

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git



More information about the Pkg-gnupg-commit mailing list