You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2010/01/11 10:04:45 UTC

svn commit: r897803 - in /commons/sandbox/runtime/trunk/src/main/native: os/unix/exec.c port/fdwalk.c

Author: mturk
Date: Mon Jan 11 09:04:45 2010
New Revision: 897803

URL: http://svn.apache.org/viewvc?rev=897803&view=rev
Log:
Close return EBADF on invalid file

Modified:
    commons/sandbox/runtime/trunk/src/main/native/os/unix/exec.c
    commons/sandbox/runtime/trunk/src/main/native/port/fdwalk.c

Modified: commons/sandbox/runtime/trunk/src/main/native/os/unix/exec.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/unix/exec.c?rev=897803&r1=897802&r2=897803&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/unix/exec.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/unix/exec.c Mon Jan 11 09:04:45 2010
@@ -160,7 +160,7 @@
     }
     /* Close the file
      */
-    return close(fd);
+    return r_close(fd);
 }
 
 static int do_exec(acr_exec_t *ep, const char *executable,

Modified: commons/sandbox/runtime/trunk/src/main/native/port/fdwalk.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/port/fdwalk.c?rev=897803&r1=897802&r2=897803&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/port/fdwalk.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/port/fdwalk.c Mon Jan 11 09:04:45 2010
@@ -92,7 +92,7 @@
     for (fd = 0; fd < fm; fd++) {
         errno = 0;
         rc = (*func)(cd, fd);
-        if (rc && errno != ENOENT)
+        if (rc && errno != ENOENT && errno != EBADF)
             break;
     }
     return rc;