package daemon: Volume::InitPackages(): Fix error case

Don't assign fListener, when starting node monitoring fails.
This commit is contained in:
Ingo Weinhold 2013-04-08 20:53:32 +02:00
parent a6c7f5e33c
commit 1047e84f39

View File

@ -174,7 +174,9 @@ Volume::InitPackages(Listener* listener)
// node-monitor the volume's packages directory
status_t error = watch_node(&fPackagesDirectoryRef, B_WATCH_DIRECTORY,
BMessenger(this));
if (error != B_OK) {
if (error == B_OK) {
fListener = listener;
} else {
ERROR("Volume::InitPackages(): failed to start watching the packages "
"directory of the volume at \"%s\": %s\n",
fPath.String(), strerror(error));
@ -182,8 +184,6 @@ Volume::InitPackages(Listener* listener)
// packages directory won't work correctly.
}
fListener = listener;
// read the packages directory and get the active packages
int fd = OpenRootDirectory();
if (fd < 0) {