diff options
author | Karel Zak | 2012-12-12 12:18:20 +0100 |
---|---|---|
committer | Karel Zak | 2012-12-12 12:18:20 +0100 |
commit | a0e35e304411e6afff334c763205671ce72bc58c (patch) | |
tree | 30007d45ab9a99271d99dd5a108d358a061392d8 /sys-utils/swapon.c | |
parent | prlimit: don't care about xasprintf() return code (diff) | |
download | kernel-qcow2-util-linux-a0e35e304411e6afff334c763205671ce72bc58c.tar.gz kernel-qcow2-util-linux-a0e35e304411e6afff334c763205671ce72bc58c.tar.xz kernel-qcow2-util-linux-a0e35e304411e6afff334c763205671ce72bc58c.zip |
swapon: don't care about xasprintf() return code
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/swapon.c')
-rw-r--r-- | sys-utils/swapon.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sys-utils/swapon.c b/sys-utils/swapon.c index 40df5220c..47ff50816 100644 --- a/sys-utils/swapon.c +++ b/sys-utils/swapon.c @@ -141,21 +141,20 @@ static void add_tt_line(struct tt *tt, struct libmnt_fs *fs, int bytes) for (i = 0; i < ncolumns; i++) { char *str = NULL; - int rc = 0; off_t size; switch (get_column_id(i)) { case COL_PATH: - rc = xasprintf(&str, "%s", mnt_fs_get_source(fs)); + xasprintf(&str, "%s", mnt_fs_get_source(fs)); break; case COL_TYPE: - rc = xasprintf(&str, "%s", mnt_fs_get_swaptype(fs)); + xasprintf(&str, "%s", mnt_fs_get_swaptype(fs)); break; case COL_SIZE: size = mnt_fs_get_size(fs); size *= 1024; /* convert to bytes */ if (bytes) - rc = xasprintf(&str, "%jd", size); + xasprintf(&str, "%jd", size); else str = size_to_human_string(SIZE_SUFFIX_1LETTER, size); break; @@ -163,18 +162,18 @@ static void add_tt_line(struct tt *tt, struct libmnt_fs *fs, int bytes) size = mnt_fs_get_usedsize(fs); size *= 1024; /* convert to bytes */ if (bytes) - rc = xasprintf(&str, "%jd", size); + xasprintf(&str, "%jd", size); else str = size_to_human_string(SIZE_SUFFIX_1LETTER, size); break; case COL_PRIO: - rc = xasprintf(&str, "%d", mnt_fs_get_priority(fs)); + xasprintf(&str, "%d", mnt_fs_get_priority(fs)); break; default: break; } - if (rc || str) + if (str) tt_line_set_data(line, i, str); } return; |