diff options
author | Karel Zak | 2014-07-22 12:24:56 +0200 |
---|---|---|
committer | Karel Zak | 2014-07-22 12:24:56 +0200 |
commit | 7c1fa4691fc40540450638bc9c15d9bd8f8d07cc (patch) | |
tree | 9513f3423d18b06d5ca7dde882b0b9ffff9b5329 /sys-utils/swapon.c | |
parent | swapon: share get_swap_prober() with swaplabel to print uuid and label (diff) | |
download | kernel-qcow2-util-linux-7c1fa4691fc40540450638bc9c15d9bd8f8d07cc.tar.gz kernel-qcow2-util-linux-7c1fa4691fc40540450638bc9c15d9bd8f8d07cc.tar.xz kernel-qcow2-util-linux-7c1fa4691fc40540450638bc9c15d9bd8f8d07cc.zip |
swapon: don't use empty strings for smartcols output
The libsmartcols is smart enough to accept NULL for empty fields
rather than empty strings.
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/swapon.c')
-rw-r--r-- | sys-utils/swapon.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/sys-utils/swapon.c b/sys-utils/swapon.c index 0c8ca03e1..02cad024a 100644 --- a/sys-utils/swapon.c +++ b/sys-utils/swapon.c @@ -199,17 +199,13 @@ static void add_scols_line(struct libscols_table *table, struct libmnt_fs *fs, i case COL_UUID: if (pr && !blkid_probe_lookup_value(pr, "UUID", &data, NULL)) xasprintf(&str, "%s", data); - else if (pr) - xasprintf(&str, ""); - else + else if (!pr) xasprintf(&str, _("read failed")); break; case COL_LABEL: if (pr && !blkid_probe_lookup_value(pr, "LABEL", &data, NULL)) xasprintf(&str, "%s", data); - else if (pr) - xasprintf(&str, ""); - else + else if (!pr) xasprintf(&str, _("read failed")); break; default: |