summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
fc42ab9)
Remove the closefds() function; it was used sporadically and was
causing problems on High Sierra. In the future look at opening
more descriptors with FD_CLOEXEC.
sbr/brkstring.h \
sbr/check_charset.h \
sbr/client.h \
sbr/brkstring.h \
sbr/check_charset.h \
sbr/client.h \
sbr/concat.h \
sbr/context_del.h \
sbr/context_find.h \
sbr/concat.h \
sbr/context_del.h \
sbr/context_find.h \
sbr/charstring.c \
sbr/check_charset.c \
sbr/client.c \
sbr/charstring.c \
sbr/check_charset.c \
sbr/client.c \
sbr/concat.c \
sbr/context_del.c \
sbr/context_find.c \
sbr/concat.c \
sbr/context_del.c \
sbr/context_find.c \
+++ /dev/null
-/* closefds.c -- close-up fd's
- *
- * This code is Copyright (c) 2002, by the authors of nmh. See the
- * COPYRIGHT file in the root directory of the nmh distribution for
- * complete copyright information.
- */
-
-#include "h/mh.h"
-#include "closefds.h"
-
-
-void
-closefds(int i)
-{
- int nbits = OPEN_MAX;
-
- for (; i < nbits; i++)
- close (i);
-}
+++ /dev/null
-/* closefds.h -- close-up fd's
- *
- * This code is Copyright (c) 2017, by the authors of nmh. See the
- * COPYRIGHT file in the root directory of the nmh distribution for
- * complete copyright information. */
-
-void closefds(int);
#include "scansbr.h"
#include "sbr/getarguments.h"
#include "sbr/smatch.h"
#include "scansbr.h"
#include "sbr/getarguments.h"
#include "sbr/smatch.h"
-#include "sbr/closefds.h"
#include "sbr/ambigsw.h"
#include "sbr/print_version.h"
#include "sbr/print_help.h"
#include "sbr/ambigsw.h"
#include "sbr/print_version.h"
#include "sbr/print_help.h"
rewind (stdin);
if (dup2 (fd, 1) == NOTOK || dup2 (fd, 2) == NOTOK)
_exit(1);
rewind (stdin);
if (dup2 (fd, 1) == NOTOK || dup2 (fd, 2) == NOTOK)
_exit(1);
setpgid(0, getpid()); /* put in own process group */
if (execvp (vec[0], vec) == NOTOK) {
_exit(1);
setpgid(0, getpid()); /* put in own process group */
if (execvp (vec[0], vec) == NOTOK) {
_exit(1);
#include "sbr/m_getfld.h"
#include "sbr/read_switch.h"
#include "sbr/concat.h"
#include "sbr/m_getfld.h"
#include "sbr/read_switch.h"
#include "sbr/concat.h"
-#include "sbr/closefds.h"
#include "sbr/uprf.h"
#include "sbr/escape_addresses.h"
#include "sbr/pidstatus.h"
#include "sbr/uprf.h"
#include "sbr/escape_addresses.h"
#include "sbr/pidstatus.h"
case OK:
dup2 (fileno (in), fileno (stdin));
dup2 (fileno (out), fileno (stdout));
case OK:
dup2 (fileno (in), fileno (stdin));
dup2 (fileno (out), fileno (stdout));
/*
* We're not allocating the memory for the extra arguments,
/*
* We're not allocating the memory for the extra arguments,
#include "sbr/seq_save.h"
#include "sbr/showfile.h"
#include "sbr/smatch.h"
#include "sbr/seq_save.h"
#include "sbr/showfile.h"
#include "sbr/smatch.h"
-#include "sbr/closefds.h"
#include "sbr/cpydata.h"
#include "sbr/m_draft.h"
#include "sbr/m_convert.h"
#include "sbr/cpydata.h"
#include "sbr/m_draft.h"
#include "sbr/m_convert.h"
for (msgnum = 0; msgnum < msgp; msgnum++) {
switch (sendsbr (vec, vecp, program, msgs[msgnum], &st, 1, auth_svc)) {
for (msgnum = 0; msgnum < msgp; msgnum++) {
switch (sendsbr (vec, vecp, program, msgs[msgnum], &st, 1, auth_svc)) {
#include "sbr/getarguments.h"
#include "sbr/smatch.h"
#include "sbr/strindex.h"
#include "sbr/getarguments.h"
#include "sbr/smatch.h"
#include "sbr/strindex.h"
-#include "sbr/closefds.h"
#include "sbr/trimcpy.h"
#include "sbr/getcpy.h"
#include "sbr/ambigsw.h"
#include "sbr/trimcpy.h"
#include "sbr/getcpy.h"
#include "sbr/ambigsw.h"
}
if (fd != 3)
dup2 (fd, 3);
}
if (fd != 3)
dup2 (fd, 3);
#ifdef TIOCNOTTY
if ((fd = open ("/dev/tty", O_RDWR)) != -1) {
#ifdef TIOCNOTTY
if ((fd = open ("/dev/tty", O_RDWR)) != -1) {
#include "sbr/smatch.h"
#include "sbr/r1bindex.h"
#include "sbr/refile.h"
#include "sbr/smatch.h"
#include "sbr/r1bindex.h"
#include "sbr/refile.h"
-#include "sbr/closefds.h"
#include "sbr/copyip.h"
#include "sbr/getcpy.h"
#include "sbr/m_draft.h"
#include "sbr/copyip.h"
#include "sbr/getcpy.h"
#include "sbr/m_draft.h"
if ((pushsw = pushed))
push ();
if ((pushsw = pushed))
push ();
if (sendsbr (vec, vecp, program, file, &st, 1, auth_svc) == OK)
done (0);
}
if (sendsbr (vec, vecp, program, file, &st, 1, auth_svc) == OK)
done (0);
}
#include "distsbr.h"
#include "sbr/getarguments.h"
#include "sbr/smatch.h"
#include "distsbr.h"
#include "sbr/getarguments.h"
#include "sbr/smatch.h"
-#include "sbr/closefds.h"
#include "sbr/m_draft.h"
#include "sbr/context_find.h"
#include "sbr/brkstring.h"
#include "sbr/m_draft.h"
#include "sbr/context_find.h"
#include "sbr/brkstring.h"
if (distsw) {
if ((child_id = fork()) == -1)
adios("fork", "failed:");
if (distsw) {
if ((child_id = fork()) == -1)
adios("fork", "failed:");