]> andersk Git - test.git/commitdiff
Remove the dependency on fdopendir, which does not exist everywhere.
authorMarkus Gutschke <markus@shellinabox.com>
Sat, 28 Feb 2009 02:45:18 +0000 (02:45 +0000)
committerMarkus Gutschke <markus@shellinabox.com>
Sat, 28 Feb 2009 02:45:18 +0000 (02:45 +0000)
ChangeLog
aclocal.m4
config.h
shellinabox/launcher.c

index 67d9d712281de73df736ee6b8ee7de43b437ad3d..3481d81872aa929d949a3fa5f5273480922c900e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-02-27  Markus Gutschke  <markus@shellinabox.com>
+
+       * Remove the dependency on fdopendir, which does not exist
+       everywhere.
+
 2009-02-16  Markus Gutschke  <markus@shellinabox.com>
 
        * Include VCS revision number in user-visible version string.
index c8d28b84440e86075bbe11c6885646af94091d7b..1d4ddbff3a74e2dedea175db041fba04a6296cf9 100644 (file)
@@ -21,7 +21,7 @@ To do so, use the procedure documented by the package, typically `autoreconf'.])
 
 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
 
-# serial 52 Debian 1.5.26-4 AC_PROG_LIBTOOL
+# serial 52 Debian 1.5.26-1ubuntu1 AC_PROG_LIBTOOL
 
 
 # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
index 4c2d0a510ce4411ecbecc60fec89389ef88390cb..b919999a3d249abc0b24d9ad431c806eb41175ce 100644 (file)
--- a/config.h
+++ b/config.h
@@ -95,7 +95,7 @@
 #define STDC_HEADERS 1
 
 /* Most recent revision number in the version control system */
-#define VCS_REVISION "68"
+#define VCS_REVISION "71"
 
 /* Version number of package */
 #define VERSION "2.4"
index d07fd1aca412f5bd5d19ea3cf76018331768e6ec..c48ed3cf9107e21d3248fc52bd8ed04a1e848a10 100644 (file)
@@ -132,10 +132,6 @@ static int (*x_misc_conv)(int, const struct pam_message **,
 #define misc_conv             x_misc_conv
 #endif
 
-// Older versions of glibc might not support fdopendir(). That's OK, we can
-// work around the lack of it, at a small performance loss.
-extern DIR *fdopendir(int) __attribute__((weak));
-
 static int   launcher = -1;
 static uid_t restricted;
 
@@ -485,8 +481,8 @@ void closeAllFds(int *exceptFds, int num) {
   // Close all file handles. If possible, scan through "/proc/self/fd" as
   // that is faster than calling close() on all possible file handles.
   int nullFd  = open("/dev/null", O_RDWR);
-  int dirFd   = !&fdopendir ? -1 : open("/proc/self/fd", O_RDONLY);
-  if (dirFd < 0) {
+  DIR *dir    = opendir("/proc/self/fd");
+  if (dir == 0) {
     for (int i = sysconf(_SC_OPEN_MAX); --i > 0; ) {
       if (i != nullFd) {
         for (int j = 0; j < num; j++) {
@@ -505,14 +501,12 @@ void closeAllFds(int *exceptFds, int num) {
     no_close_1:;
     }
   } else {
-    DIR *dir;
-    check(dir = fdopendir(dirFd));
     struct dirent de, *res;
     while (!readdir_r(dir, &de, &res) && res) {
       if (res->d_name[0] < '0')
         continue;
       int fd  = atoi(res->d_name);
-      if (fd != nullFd && fd != dirFd) {
+      if (fd != nullFd && fd != dirfd(dir)) {
         for (int j = 0; j < num; j++) {
           if (fd == exceptFds[j]) {
             goto no_close_2;
This page took 0.51438 seconds and 5 git commands to generate.