Fossil SCM
Move signal handling into popen.c (wrapped in #ifdef).
Commit
3760ac92ba43e59b0548753393aea440770b5237
Parent
f15adbba0e6235d…
2 files changed
-1
+2
-1
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -625,11 +625,10 @@ | ||
| 625 | 625 | "%s: could be any of:%s\n" |
| 626 | 626 | "%s: use \"help\" for more information\n", |
| 627 | 627 | g.argv[0], zCmdName, g.argv[0], blob_str(&couldbe), g.argv[0]); |
| 628 | 628 | fossil_exit(1); |
| 629 | 629 | } |
| 630 | - signal(SIGPIPE,SIG_IGN); | |
| 631 | 630 | atexit( fossil_atexit ); |
| 632 | 631 | aCommand[idx].xFunc(); |
| 633 | 632 | fossil_exit(0); |
| 634 | 633 | /*NOT_REACHED*/ |
| 635 | 634 | return 0; |
| 636 | 635 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -625,11 +625,10 @@ | |
| 625 | "%s: could be any of:%s\n" |
| 626 | "%s: use \"help\" for more information\n", |
| 627 | g.argv[0], zCmdName, g.argv[0], blob_str(&couldbe), g.argv[0]); |
| 628 | fossil_exit(1); |
| 629 | } |
| 630 | signal(SIGPIPE,SIG_IGN); |
| 631 | atexit( fossil_atexit ); |
| 632 | aCommand[idx].xFunc(); |
| 633 | fossil_exit(0); |
| 634 | /*NOT_REACHED*/ |
| 635 | return 0; |
| 636 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -625,11 +625,10 @@ | |
| 625 | "%s: could be any of:%s\n" |
| 626 | "%s: use \"help\" for more information\n", |
| 627 | g.argv[0], zCmdName, g.argv[0], blob_str(&couldbe), g.argv[0]); |
| 628 | fossil_exit(1); |
| 629 | } |
| 630 | atexit( fossil_atexit ); |
| 631 | aCommand[idx].xFunc(); |
| 632 | fossil_exit(0); |
| 633 | /*NOT_REACHED*/ |
| 634 | return 0; |
| 635 |
+2
| --- src/popen.c | ||
| +++ src/popen.c | ||
| @@ -17,10 +17,11 @@ | ||
| 17 | 17 | ** |
| 18 | 18 | ** This file contains an implementation of a bi-directional popen(). |
| 19 | 19 | */ |
| 20 | 20 | #include "config.h" |
| 21 | 21 | #include "popen.h" |
| 22 | +#include <signal.h> | |
| 22 | 23 | |
| 23 | 24 | #ifdef _WIN32 |
| 24 | 25 | #include <windows.h> |
| 25 | 26 | #include <fcntl.h> |
| 26 | 27 | /* |
| @@ -171,10 +172,11 @@ | ||
| 171 | 172 | close(pout[0]); |
| 172 | 173 | close(pout[1]); |
| 173 | 174 | *pChildPid = 0; |
| 174 | 175 | return 1; |
| 175 | 176 | } |
| 177 | + signal(SIGPIPE,SIG_IGN); | |
| 176 | 178 | if( *pChildPid==0 ){ |
| 177 | 179 | int fd; |
| 178 | 180 | int nErr = 0; |
| 179 | 181 | /* This is the child process */ |
| 180 | 182 | close(0); |
| 181 | 183 |
| --- src/popen.c | |
| +++ src/popen.c | |
| @@ -17,10 +17,11 @@ | |
| 17 | ** |
| 18 | ** This file contains an implementation of a bi-directional popen(). |
| 19 | */ |
| 20 | #include "config.h" |
| 21 | #include "popen.h" |
| 22 | |
| 23 | #ifdef _WIN32 |
| 24 | #include <windows.h> |
| 25 | #include <fcntl.h> |
| 26 | /* |
| @@ -171,10 +172,11 @@ | |
| 171 | close(pout[0]); |
| 172 | close(pout[1]); |
| 173 | *pChildPid = 0; |
| 174 | return 1; |
| 175 | } |
| 176 | if( *pChildPid==0 ){ |
| 177 | int fd; |
| 178 | int nErr = 0; |
| 179 | /* This is the child process */ |
| 180 | close(0); |
| 181 |
| --- src/popen.c | |
| +++ src/popen.c | |
| @@ -17,10 +17,11 @@ | |
| 17 | ** |
| 18 | ** This file contains an implementation of a bi-directional popen(). |
| 19 | */ |
| 20 | #include "config.h" |
| 21 | #include "popen.h" |
| 22 | #include <signal.h> |
| 23 | |
| 24 | #ifdef _WIN32 |
| 25 | #include <windows.h> |
| 26 | #include <fcntl.h> |
| 27 | /* |
| @@ -171,10 +172,11 @@ | |
| 172 | close(pout[0]); |
| 173 | close(pout[1]); |
| 174 | *pChildPid = 0; |
| 175 | return 1; |
| 176 | } |
| 177 | signal(SIGPIPE,SIG_IGN); |
| 178 | if( *pChildPid==0 ){ |
| 179 | int fd; |
| 180 | int nErr = 0; |
| 181 | /* This is the child process */ |
| 182 | close(0); |
| 183 |