aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-03-29 09:26:02 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-03-29 09:26:02 +0000
commitb95360d5bc9e5463157d91656aaac22180c24f1a (patch)
tree8264d934bb0fecf048f0984720edfda69f3f59cd
parent9701e09587723ef3648cd730850198ca20942911 (diff)
downloadupstream-b95360d5bc9e5463157d91656aaac22180c24f1a.tar.gz
upstream-b95360d5bc9e5463157d91656aaac22180c24f1a.tar.bz2
upstream-b95360d5bc9e5463157d91656aaac22180c24f1a.zip
uhttpd: fix a signal related race condition exposed by LuCI on fast machines
SVN-Revision: 20573
-rw-r--r--package/uhttpd/Makefile2
-rw-r--r--package/uhttpd/src/uhttpd-cgi.c3
-rw-r--r--package/uhttpd/src/uhttpd-lua.c5
3 files changed, 7 insertions, 3 deletions
diff --git a/package/uhttpd/Makefile b/package/uhttpd/Makefile
index 4bee17d234..180e2284c3 100644
--- a/package/uhttpd/Makefile
+++ b/package/uhttpd/Makefile
@@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=uhttpd
-PKG_RELEASE:=5
+PKG_RELEASE:=6
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
diff --git a/package/uhttpd/src/uhttpd-cgi.c b/package/uhttpd/src/uhttpd-cgi.c
index 28686b47e2..1a6c6ad4fe 100644
--- a/package/uhttpd/src/uhttpd-cgi.c
+++ b/package/uhttpd/src/uhttpd-cgi.c
@@ -562,7 +562,10 @@ void uh_cgi_request(struct client *cl, struct http_request *req, struct path_inf
close(wfd[1]);
if( !kill(child, 0) )
+ {
kill(child, SIGTERM);
+ waitpid(child, NULL, 0);
+ }
break;
}
diff --git a/package/uhttpd/src/uhttpd-lua.c b/package/uhttpd/src/uhttpd-lua.c
index b3f3cb498f..c2efe33849 100644
--- a/package/uhttpd/src/uhttpd-lua.c
+++ b/package/uhttpd/src/uhttpd-lua.c
@@ -533,7 +533,10 @@ void uh_lua_request(struct client *cl, struct http_request *req, lua_State *L)
close(wfd[1]);
if( !kill(child, 0) )
+ {
kill(child, SIGTERM);
+ waitpid(child, NULL, 0);
+ }
break;
}
@@ -543,5 +546,3 @@ void uh_lua_close(lua_State *L)
{
lua_close(L);
}
-
-