From 5bbe88c7ac3e3f3fd8704761778822342bf7dc07 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 20 Mar 2015 11:12:57 +0100 Subject: check for correct return values --- udev-block-notify.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/udev-block-notify.c b/udev-block-notify.c index ef9ba18..06ea7e2 100644 --- a/udev-block-notify.c +++ b/udev-block-notify.c @@ -95,13 +95,12 @@ int main (int argc, char ** argv) { printf("%s: %s v%s (compiled: " __DATE__ ", " __TIME__ ")\n", argv[0], PROGNAME, VERSION); - if(!notify_init("Udev-Block-Notification")) { + if(notify_init("Udev-Block-Notification") == FALSE) { fprintf(stderr, "%s: Can't create notify.\n", argv[0]); exit(EXIT_FAILURE); } - udev = udev_new(); - if(!udev) { + if ((udev = udev_new()) == NULL) { fprintf(stderr, "%s: Can't create udev.\n", argv[0]); exit(EXIT_FAILURE); } @@ -238,7 +237,7 @@ int main (int argc, char ** argv) { notify_notification_update(notification, TEXT_TOPIC, notifystr, icon); notify_notification_set_timeout(notification, NOTIFICATION_TIMEOUT); - while(!notify_notification_show(notification, &error)) { + while(notify_notification_show(notification, &error) == FALSE) { if (errcount > 1) { fprintf(stderr, "%s: Looks like we can not reconnect to notification daemon... Exiting.\n", argv[0]); exit(EXIT_FAILURE); @@ -253,7 +252,7 @@ int main (int argc, char ** argv) { usleep(500 * 1000); - if(!notify_init("Udev-Block-Notification")) { + if(notify_init("Udev-Block-Notification") == FALSE) { fprintf(stderr, "%s: Can't create notify.\n", argv[0]); exit(EXIT_FAILURE); } -- cgit v1.2.3-70-g09d2