syslog_daemon: don't delete the port on quit.
* It belongs to the launch daemon.
This commit is contained in:
@@ -28,6 +28,9 @@
|
|||||||
#define B_TRANSLATION_CONTEXT "SyslogDaemon"
|
#define B_TRANSLATION_CONTEXT "SyslogDaemon"
|
||||||
|
|
||||||
|
|
||||||
|
static const int32 kQuitDaemon = 'quit';
|
||||||
|
|
||||||
|
|
||||||
SyslogDaemon::SyslogDaemon()
|
SyslogDaemon::SyslogDaemon()
|
||||||
:
|
:
|
||||||
BApplication(B_SYSTEM_LOGGER_SIGNATURE),
|
BApplication(B_SYSTEM_LOGGER_SIGNATURE),
|
||||||
@@ -89,10 +92,8 @@ SyslogDaemon::AboutRequested()
|
|||||||
bool
|
bool
|
||||||
SyslogDaemon::QuitRequested()
|
SyslogDaemon::QuitRequested()
|
||||||
{
|
{
|
||||||
delete_port(fPort);
|
write_port(fPort, kQuitDaemon, NULL, 0);
|
||||||
|
wait_for_thread(fDaemon, NULL);
|
||||||
int32 returnCode;
|
|
||||||
wait_for_thread(fDaemon, &returnCode);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -144,6 +145,9 @@ SyslogDaemon::_Daemon()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (code == kQuitDaemon)
|
||||||
|
return;
|
||||||
|
|
||||||
// if we don't get what we want, ignore it
|
// if we don't get what we want, ignore it
|
||||||
if (bytesRead < (ssize_t)sizeof(syslog_message)
|
if (bytesRead < (ssize_t)sizeof(syslog_message)
|
||||||
|| code != SYSLOG_MESSAGE)
|
|| code != SYSLOG_MESSAGE)
|
||||||
|
|||||||
Reference in New Issue
Block a user