| Date: Mon, 7 Mar 2011 22:01:11 +0100
Running scripts should now exit as expected.
Diffstat:
handlr.c | 13 ++++++++++++-
main.c | 1 +
2 files changed, 13 insertions(+), 1 deletion(-)
--- |
| @@ -15,6 +15,7 @@
#include
#include
#include
+#include
#include "ind.h"
#include "arg.h"
@@ -177,6 +178,16 @@ handlecgi(int sock, char *file, char *port, char *base, char *args,
if(sear == nil)
sear = "";
- execl(file, p, sear, args, (char *)nil);
+ switch(fork()) {
+ case 0:
+ execl(file, p, sear, args, (char *)nil);
+ case -1:
+ break;
+ default:
+ wait(NULL);
+ shutdown(sock, SHUT_RDWR);
+ close(sock);
+ break;
+ }
}
|