From: jow Date: Mon, 29 Mar 2010 09:26:02 +0000 (+0000) Subject: [package] uhttpd: fix a signal related race condition exposed by LuCI on fast machines X-Git-Url: https://git.rohieb.name/openwrt.git/commitdiff_plain/800c7f427ae8f51939f681301230de21d2f2f4f0 [package] uhttpd: fix a signal related race condition exposed by LuCI on fast machines git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20573 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- diff --git a/package/uhttpd/Makefile b/package/uhttpd/Makefile index 4bee17d23..180e2284c 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 28686b47e..1a6c6ad4f 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 b3f3cb498..c2efe3384 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); } - -