Changeset 2115 for box/trunk/lib/server/Daemon.cpp
- Timestamp:
- 28/03/2008 22:18:44 (4 years ago)
- File:
-
- 1 edited
-
box/trunk/lib/server/Daemon.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
box/trunk/lib/server/Daemon.cpp
r2110 r2115 466 466 if(::setsid() == -1) 467 467 { 468 BOX_ERROR("Failed to setsid(): " << 469 strerror(errno)); 468 BOX_LOG_SYS_ERROR("Failed to setsid()"); 470 469 THROW_EXCEPTION(ServerException, DaemoniseFailed) 471 470 } … … 476 475 case -1: 477 476 // error 477 BOX_LOG_SYS_ERROR("Failed to fork() a child"); 478 478 THROW_EXCEPTION(ServerException, DaemoniseFailed) 479 479 break; … … 498 498 sa.sa_handler = SignalHandler; 499 499 sa.sa_flags = 0; 500 sigemptyset(&sa.sa_mask); // macro 501 if(::sigaction(SIGHUP, &sa, NULL) != 0 || ::sigaction(SIGTERM, &sa, NULL) != 0) 502 { 500 sigemptyset(&sa.sa_mask); // macro 501 if(::sigaction(SIGHUP, &sa, NULL) != 0 || 502 ::sigaction(SIGTERM, &sa, NULL) != 0) 503 { 504 BOX_LOG_SYS_ERROR("Failed to set signal handlers"); 503 505 THROW_EXCEPTION(ServerException, DaemoniseFailed) 504 506 } … … 516 518 if(::write(pidFile, pid, pidsize) != pidsize) 517 519 { 518 BOX_FATAL("can't write pid file"); 520 BOX_LOG_SYS_FATAL("Failed to write PID file: " << 521 pidFileName); 519 522 THROW_EXCEPTION(ServerException, DaemoniseFailed) 520 523 } … … 545 548 if(devnull == -1) 546 549 { 550 BOX_LOG_SYS_ERROR("Failed to open /dev/null"); 547 551 THROW_EXCEPTION(CommonException, OSFileError); 548 552 } … … 891 895 return 0; 892 896 } 897 BOX_LOG_SYS_ERROR("Failed to stat configuration file: " << 898 GetConfigFileName()); 893 899 THROW_EXCEPTION(CommonException, OSFileError) 894 900 }
Note: See TracChangeset
for help on using the changeset viewer.
