Changeset 988
- Timestamp:
- 03/25/07 13:33:06 (2 years ago)
- Files:
-
- trunk/pdns/pdns/pdns_recursor.cc (modified) (1 diff)
- trunk/pdns/pdns/rec_channel.cc (modified) (2 diffs)
- trunk/pdns/pdns/rec_channel_rec.cc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/pdns/pdns/pdns_recursor.cc
r972 r988 396 396 } 397 397 398 398 string s_pidfname; 399 399 static void writePid(void) 400 400 { 401 s tringfname=::arg()["socket-dir"]+"/"+s_programname+".pid";402 ofstream of( fname.c_str());401 s_pidfname=::arg()["socket-dir"]+"/"+s_programname+".pid"; 402 ofstream of(s_pidfname.c_str()); 403 403 if(of) 404 404 of<< Utility::getpid() <<endl; 405 405 else 406 L<<Logger::Error<<"Requested to write pid for "<<Utility::getpid()<<" to "<< fname<<" failed: "<<strerror(errno)<<endl;406 L<<Logger::Error<<"Requested to write pid for "<<Utility::getpid()<<" to "<<s_pidfname<<" failed: "<<strerror(errno)<<endl; 407 407 } 408 408 trunk/pdns/pdns/rec_channel.cc
r945 r988 27 27 int RecursorControlChannel::listen(const string& fname) 28 28 { 29 struct sockaddr_un local;30 29 d_fd=socket(AF_UNIX,SOCK_DGRAM,0); 31 30 … … 41 40 throw AhuException("Can't remove (previous) controlsocket '"+fname+"': "+string(strerror(errno)) + " (try --socket-dir)"); 42 41 43 memset(& local,0,sizeof(local));44 local.sun_family=AF_UNIX;45 strcpy( local.sun_path, fname.c_str());42 memset(&d_local,0,sizeof(d_local)); 43 d_local.sun_family=AF_UNIX; 44 strcpy(d_local.sun_path, fname.c_str()); 46 45 47 if(bind(d_fd, (sockaddr*)& local,sizeof(local))<0)46 if(bind(d_fd, (sockaddr*)&d_local,sizeof(d_local))<0) 48 47 throw AhuException("Unable to bind to controlsocket '"+fname+"': "+string(strerror(errno))); 49 48 trunk/pdns/pdns/rec_channel_rec.cc
r935 r988 231 231 { 232 232 L<<Logger::Error<<"Exiting on user request"<<endl; 233 extern RecursorControlChannel s_rcc; 234 s_rcc.~RecursorControlChannel(); 235 236 extern string s_pidfname; 237 if(!s_pidfname.empty()) 238 unlink(s_pidfname.c_str()); // we can at least try.. 233 239 _exit(1); 234 240 }