summaryrefslogtreecommitdiffstats
path: root/udev-block-notify.c
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2015-03-20 11:12:57 +0100
committerGravatar Christian Hesse <mail@eworm.de>2015-03-20 11:12:57 +0100
commit5bbe88c7ac3e3f3fd8704761778822342bf7dc07 (patch)
tree30c4cc2793be0b2641fb4b5fab3b1d0b754e55be /udev-block-notify.c
parent9cd97c451679cba2278cae069181b9f827968f65 (diff)
downloadudev-block-notify-5bbe88c7ac3e3f3fd8704761778822342bf7dc07.tar.gz
udev-block-notify-5bbe88c7ac3e3f3fd8704761778822342bf7dc07.tar.zst
check for correct return values
Diffstat (limited to 'udev-block-notify.c')
-rw-r--r--udev-block-notify.c9
1 files 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);
}