diff options
| author | Hajimu UMEMOTO <ume@FreeBSD.org> | 2014-09-02 18:01:38 +0000 |
|---|---|---|
| committer | Hajimu UMEMOTO <ume@FreeBSD.org> | 2014-09-02 18:01:38 +0000 |
| commit | a5a9cdf79fb052ed4da0fd53782135888e5c21c1 (patch) | |
| tree | 4936c966f3244f3f12a68dcc37df309d1f04aecf /net/irrd/files/patch-uii_commands.c | |
| parent | Fix syntax of USES=pgsql (diff) | |
- Resurrect net/irrd with stagify.
- Take maintainership.
- Strip installed binary.
- Use shebangfix for perl scripts.
Diffstat (limited to 'net/irrd/files/patch-uii_commands.c')
| -rw-r--r-- | net/irrd/files/patch-uii_commands.c | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/net/irrd/files/patch-uii_commands.c b/net/irrd/files/patch-uii_commands.c new file mode 100644 index 000000000000..9f1dbfe8b986 --- /dev/null +++ b/net/irrd/files/patch-uii_commands.c @@ -0,0 +1,55 @@ +--- programs/IRRd/uii_commands.c.orig Tue Feb 5 05:53:57 2002 ++++ programs/IRRd/uii_commands.c Thu Apr 22 18:13:29 2004 +@@ -14,6 +14,8 @@ + #include <ctype.h> + #include "irrd.h" + ++#include <errno.h> ++ + #include <fcntl.h> + #ifndef SETPGRP_VOID + #endif +@@ -720,6 +722,10 @@ + + void run_cmd (char *cmd, FILE **in, FILE **out) { + int pin[2], pout[2]; ++ int pid; ++ int omask, pstat; ++ pid_t ppid; ++ extern int errno; + + if (in != NULL) + *in = NULL; +@@ -733,7 +739,9 @@ + if (out != NULL) + pipe (pout); + +- if (fork() == 0) { /* We're the child */ ++/* if (fork() == 0) { */ ++ pid = fork(); ++ if (pid == 0) { /* We're the child */ + if (in != NULL) { + close (pin[1]); + dup2 (pin[0], 0); +@@ -747,7 +755,7 @@ + close (pout[1]); + } + +- execl("/bin/sh", "sh", "-c", cmd, NULL); ++ execlp("/bin/sh", "sh", "-c", cmd, NULL); + _exit(127); + } + +@@ -761,6 +769,12 @@ + close (pin[0]); + *in = fdopen (pin[1], "w"); + } ++ ++ omask = sigblock(sigmask(SIGINT)|sigmask(SIGQUIT)|sigmask(SIGHUP)); ++ do { ++ ppid = waitpid(pid, (int *) &pstat, 0); ++ } while (pid == -1 && errno == EINTR); ++ (void)sigsetmask(omask); + } + + int kill_irrd (uii_connection_t *uii) { |
