]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix a potential unit test breakage on GNU/Linux.
authorPhilipp Stephani <phst@google.com>
Wed, 30 Dec 2020 23:05:14 +0000 (00:05 +0100)
committerPhilipp Stephani <phst@google.com>
Wed, 30 Dec 2020 23:06:04 +0000 (00:06 +0100)
* test/src/process-tests.el
(process-tests/fd-setsize-no-crash/make-process): Allow special exit
codes that can happen if terminal setup fails in the child process.

test/src/process-tests.el

index 3a19b6c6f143106cafbfcd4adc7fb2ee284e7a83..590f72f9b03c0b7cd93626d7853942a53aa96570 100644 (file)
@@ -525,7 +525,14 @@ FD_SETSIZE file descriptors (Bug#24325)."
               (dolist (process processes)
                 (while (accept-process-output process))
                 (should (eq (process-status process) 'exit))
-                (should (eql (process-exit-status process) 0))))))))))
+                ;; If there's an error between fork and exec, Emacs
+                ;; will use exit statuses between 125 and 127, see
+                ;; process.h.  This can happen if the child process
+                ;; tries to set up terminal device but fails due to
+                ;; file number limits.  We don't treat this as an
+                ;; error.
+                (should (memql (process-exit-status process)
+                               '(0 125 126 127)))))))))))
 
 (ert-deftest process-tests/fd-setsize-no-crash/make-pipe-process ()
   "Check that Emacs doesn't crash when trying to use more than