Use -1 instead of 0 for the notifyd token "missing value" sentinel

This matches NOTIFY_TOKEN_INVALID
This commit is contained in:
ridiculousfish
2014-11-19 11:42:12 -08:00
parent 93eea8de66
commit dda6be2592

View File

@@ -1276,14 +1276,14 @@ class universal_notifier_notifyd_t : public universal_notifier_t
}
public:
universal_notifier_notifyd_t() : notify_fd(-1), token(0)
universal_notifier_notifyd_t() : notify_fd(-1), token(-1 /* NOTIFY_TOKEN_INVALID */)
{
setup_notifyd();
}
~universal_notifier_notifyd_t()
{
if (token != 0)
if (token != -1 /* NOTIFY_TOKEN_INVALID */)
{
#if FISH_NOTIFYD_AVAILABLE
notify_cancel(token);