From: Fredrik Tolf Date: Fri, 3 Sep 2010 04:45:53 +0000 (+0200) Subject: callscgi: Fixed a couple of simple bugs. X-Git-Tag: 0.1~37 X-Git-Url: http://www.dolda2000.com/gitweb/?p=ashd.git;a=commitdiff_plain;h=1376c0cd7305687b21c21664e4f3919e9f5fbddb callscgi: Fixed a couple of simple bugs. --- diff --git a/src/callscgi.c b/src/callscgi.c index c5b5499..243f323 100644 --- a/src/callscgi.c +++ b/src/callscgi.c @@ -98,13 +98,14 @@ static char *mkanonid(void) home = getenv("HOME"); if(home && !access(sprintf3("%s/.ashd/sockets/", home), X_OK)) - tmpl = sprintf2("%s/.ashd/sockets/scgi-a-XXXXXX"); + tmpl = sprintf2("%s/.ashd/sockets/scgi-a-XXXXXX", home); else tmpl = sprintf2("/tmp/scgi-a-%i-XXXXXX", getuid()); if((fd = mkstemp(tmpl)) < 0) { flog(LOG_ERR, "could not create anonymous socket `%s': %s", tmpl, strerror(errno)); exit(1); } + close(fd); unlink(tmpl); return(tmpl); }