Changeset 180 for trunk/pdns/pdns/pdns_recursor.cc
- Timestamp:
- 08/22/03 15:33:31 (10 years ago)
- Files:
-
- 1 modified
-
trunk/pdns/pdns/pdns_recursor.cc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pdns/pdns/pdns_recursor.cc
r178 r180 36 36 #include "arguments.hh" 37 37 #include "syncres.hh" 38 #include <fcntl.h> 39 #include <fstream> 40 41 string s_programname="pdns_recursor"; 38 42 39 43 #ifndef WIN32 … … 161 165 162 166 167 static void writePid(void) 168 { 169 string fname=arg()["socket-dir"]+"/"+s_programname+".pid"; 170 ofstream of(fname.c_str()); 171 if(of) 172 of<<getpid()<<endl; 173 else 174 L<<Logger::Error<<"Requested to write pid for "<<getpid()<<" to "<<fname<<"failed: "<<strerror(errno)<<endl; 175 } 176 163 177 void init(void) 164 178 { … … 432 446 arg().set("quiet","Suppress logging of questions and answers")="off"; 433 447 arg().set("config-dir","Location of configuration directory (recursor.conf)")=SYSCONFDIR; 448 arg().set("socket-dir","Where the controlsocket will live")=LOCALSTATEDIR; 434 449 arg().setCmd("help","Provide a helpful message"); 435 450 L.toConsole(Logger::Warning); … … 471 486 } 472 487 signal(SIGUSR1,usr1Handler); 488 489 writePid(); 473 490 #endif 474 491