summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2015-05-29 09:49:07 +0200
committerGravatar Christian Hesse <mail@eworm.de>2015-05-29 09:49:07 +0200
commit3a4743e5aed552460840fe4b1dbc0990ca4dd91f (patch)
tree7f67fef4700b4c8024d6ea971494247c2a2614c0
parentd2d42a9e1f37b187275bce7ed255e6b871f0c277 (diff)
downloadudev-block-notify-3a4743e5aed552460840fe4b1dbc0990ca4dd91f.tar.gz
udev-block-notify-3a4743e5aed552460840fe4b1dbc0990ca4dd91f.tar.zst
do not add empty string
-rw-r--r--udev-block-notify.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/udev-block-notify.c b/udev-block-notify.c
index 06ea7e2..10ec41b 100644
--- a/udev-block-notify.c
+++ b/udev-block-notify.c
@@ -161,29 +161,29 @@ int main (int argc, char ** argv) {
* Values available differs from device type and content */
/* file system */
- if ((value = udev_device_get_property_value(dev, "ID_FS_LABEL")) != NULL)
+ if ((value = udev_device_get_property_value(dev, "ID_FS_LABEL")) != NULL && *value != 0)
notifystr = appendstr(TEXT_TAG, notifystr, "Label", value);
- if ((value = udev_device_get_property_value(dev, "ID_FS_TYPE")) != NULL)
+ if ((value = udev_device_get_property_value(dev, "ID_FS_TYPE")) != NULL && *value != 0)
notifystr = appendstr(TEXT_TAG, notifystr, "Type", value);
- if ((value = udev_device_get_property_value(dev, "ID_FS_USAGE")) != NULL)
+ if ((value = udev_device_get_property_value(dev, "ID_FS_USAGE")) != NULL && *value != 0)
notifystr = appendstr(TEXT_TAG, notifystr, "Usage", value);
- if ((value = udev_device_get_property_value(dev, "ID_FS_UUID")) != NULL)
+ if ((value = udev_device_get_property_value(dev, "ID_FS_UUID")) != NULL && *value != 0)
notifystr = appendstr(TEXT_TAG, notifystr, "UUID", value);
/* partition */
- if ((value = udev_device_get_property_value(dev, "ID_PART_TABLE_TYPE")) != NULL)
+ if ((value = udev_device_get_property_value(dev, "ID_PART_TABLE_TYPE")) != NULL && *value != 0)
notifystr = appendstr(TEXT_TAG, notifystr, "Partition Table Type", value);
- if ((value = udev_device_get_property_value(dev, "ID_PART_TABLE_NAME")) != NULL)
+ if ((value = udev_device_get_property_value(dev, "ID_PART_TABLE_NAME")) != NULL && *value != 0)
notifystr = appendstr(TEXT_TAG, notifystr, "Partition Name", value);
- if ((value = udev_device_get_property_value(dev, "ID_PART_ENTRY_TYPE")) != NULL)
+ if ((value = udev_device_get_property_value(dev, "ID_PART_ENTRY_TYPE")) != NULL && *value != 0)
notifystr = appendstr(TEXT_TAG, notifystr, "Partition Type", value);
/* device mapper */
- if ((value = udev_device_get_property_value(dev, "DM_NAME")) != NULL)
+ if ((value = udev_device_get_property_value(dev, "DM_NAME")) != NULL && *value != 0)
notifystr = appendstr(TEXT_TAG, notifystr, "Device mapper name", value);
/* multi disk */
- if ((value = udev_device_get_property_value(dev, "MD_LEVEL")) != NULL)
+ if ((value = udev_device_get_property_value(dev, "MD_LEVEL")) != NULL && *value != 0)
notifystr = appendstr(TEXT_TAG, notifystr, "Multi disk level", value);
if (verbose > 0)