From: Bert Hubert Date: Sat, 22 Mar 2008 20:43:44 +0000 (+0000) Subject: improve pid writing logic, plus control-socket separation. Patch by Matti Hiljanen. X-Git-Tag: rec-3.1.7.1~71 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=815099b20056fb23aae2a8a4b641cd3ac9752580;p=thirdparty%2Fpdns.git improve pid writing logic, plus control-socket separation. Patch by Matti Hiljanen. git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1170 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 106b8a435a..74c5a97712 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -404,8 +404,7 @@ static void setSendBuffer(int fd, uint32_t size) string s_pidfname; static void writePid(void) { - s_pidfname=::arg()["socket-dir"]+"/"+s_programname+".pid"; - ofstream of(s_pidfname.c_str()); + ofstream of(s_pidfname.c_str(), ios_base::app); if(of) of<< Utility::getpid() <(::arg().asNum("stack-size")); - makeControlChannelSocket(); PacketID pident; primeHints(); L< 0) close(d_fd); - if(*d_local.sun_path && !d_dontclose) + if(*d_local.sun_path) unlink(d_local.sun_path); } diff --git a/pdns/rec_channel.hh b/pdns/rec_channel.hh index b89063b283..4a381a5007 100644 --- a/pdns/rec_channel.hh +++ b/pdns/rec_channel.hh @@ -32,7 +32,6 @@ public: std::string recv(std::string* remote=0); int d_fd; - bool d_dontclose; private: struct sockaddr_un d_local; };