syslog_daemon: don't delete the port on quit.

* It belongs to the launch daemon.
This commit is contained in:
Axel Dörfler
2015-07-22 20:40:56 +02:00
parent 798ad3db30
commit 7ef0edec04
+8 -4
View File
@@ -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)