projects
/
egate.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3871eda
)
Better error handling when (re)spawn of the shell fails.
author
Adam Dickmeiss
<adam@indexdata.dk>
Mon, 26 Feb 1996 10:36:15 +0000
(10:36 +0000)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Mon, 26 Feb 1996 10:36:15 +0000
(10:36 +0000)
www/wcgi.c
patch
|
blob
|
history
diff --git
a/www/wcgi.c
b/www/wcgi.c
index
09b1ff9
..
6242f90
100644
(file)
--- a/
www/wcgi.c
+++ b/
www/wcgi.c
@@
-41,7
+41,10
@@
* USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $Log: wcgi.c,v $
* USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $Log: wcgi.c,v $
- * Revision 1.16 1996/02/12 10:10:29 adam
+ * Revision 1.17 1996/02/26 10:36:15 adam
+ * Better error handling when (re)spawn of the shell fails.
+ *
+ * Revision 1.16 1996/02/12 10:10:29 adam
* Resource/config system used by the gateway.
*
* Revision 1.15 1996/01/26 09:02:20 adam
* Resource/config system used by the gateway.
*
* Revision 1.15 1996/01/26 09:02:20 adam
@@
-143,7
+146,7
@@
static void fatal(char *p)
static int spawn (char *sprog, int id)
{
static int spawn (char *sprog, int id)
{
- int r;
+ int r, fd;
char path[256];
char envstr[80];
char path[256];
char envstr[80];
@@
-154,7
+157,7
@@
static int spawn (char *sprog, int id)
{
case -1:
gw_log (GW_LOG_FATAL|GW_LOG_ERRNO, prog, "fork");
{
case -1:
gw_log (GW_LOG_FATAL|GW_LOG_ERRNO, prog, "fork");
- exit(1);
+ fatal ("Internal error in server");
case 0:
close (0);
close (1);
case 0:
close (0);
close (1);
@@
-162,7
+165,13
@@
static int spawn (char *sprog, int id)
gw_log (GW_LOG_DEBUG, prog, "execl %s", path);
execl (path, sprog, 0);
gw_log (GW_LOG_FATAL|GW_LOG_ERRNO, prog, "execl %s", path);
gw_log (GW_LOG_DEBUG, prog, "execl %s", path);
execl (path, sprog, 0);
gw_log (GW_LOG_FATAL|GW_LOG_ERRNO, prog, "execl %s", path);
- exit(0);
+ fd = open (serverp, O_WRONLY);
+ if (fd >= 0)
+ {
+ write (fd, "FA", 2);
+ close (fd);
+ }
+ exit(1);
default:
return r;
}
default:
return r;
}