From b40cdfbe66b2f87c40a2b3c1d8a0847a91884741 Mon Sep 17 00:00:00 2001 From: "roberto@quantal64" Date: Fri, 8 Jun 2012 20:55:15 +0200 Subject: [PATCH] fixed spooler with chdir --- spooler.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spooler.c b/spooler.c index 0dc21baf..27963e72 100644 --- a/spooler.c +++ b/spooler.c @@ -548,6 +548,12 @@ void spooler_manage_task(struct uwsgi_spooler *uspool, char *dir, char *task) { uwsgi_protected_close(spool_fd); uspool->running = 0; + if (chdir(dir)) { + uwsgi_error("chdir()"); + uwsgi_log("[spooler] something horrible happened to the spooler. Better to kill it.\n"); + exit(1); + } + if (!callable_found) { uwsgi_log("unable to find the spooler function, have you loaded it into the spooler process ?\n"); }