Fossil SCM

Move signal handling into popen.c (wrapped in #ifdef).

amb 2013-07-18 01:00 ssh-transport-changes
Commit 3760ac92ba43e59b0548753393aea440770b5237
2 files changed -1 +2
-1
--- src/main.c
+++ src/main.c
@@ -625,11 +625,10 @@
625625
"%s: could be any of:%s\n"
626626
"%s: use \"help\" for more information\n",
627627
g.argv[0], zCmdName, g.argv[0], blob_str(&couldbe), g.argv[0]);
628628
fossil_exit(1);
629629
}
630
- signal(SIGPIPE,SIG_IGN);
631630
atexit( fossil_atexit );
632631
aCommand[idx].xFunc();
633632
fossil_exit(0);
634633
/*NOT_REACHED*/
635634
return 0;
636635
--- 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
--- src/popen.c
+++ src/popen.c
@@ -17,10 +17,11 @@
1717
**
1818
** This file contains an implementation of a bi-directional popen().
1919
*/
2020
#include "config.h"
2121
#include "popen.h"
22
+#include <signal.h>
2223
2324
#ifdef _WIN32
2425
#include <windows.h>
2526
#include <fcntl.h>
2627
/*
@@ -171,10 +172,11 @@
171172
close(pout[0]);
172173
close(pout[1]);
173174
*pChildPid = 0;
174175
return 1;
175176
}
177
+ signal(SIGPIPE,SIG_IGN);
176178
if( *pChildPid==0 ){
177179
int fd;
178180
int nErr = 0;
179181
/* This is the child process */
180182
close(0);
181183
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button