diff options
author | Karel Zak | 2017-06-21 10:53:28 +0200 |
---|---|---|
committer | Karel Zak | 2017-06-21 10:53:28 +0200 |
commit | 6f1507f135bce5ba7f318c44e05327ca14a0505a (patch) | |
tree | 95c9c076aeb6da10f154dd2ae5bd3a035ee2bd53 /misc-utils/wipefs.c | |
parent | build-sys: chown before chmod for SUIDs (diff) | |
download | kernel-qcow2-util-linux-6f1507f135bce5ba7f318c44e05327ca14a0505a.tar.gz kernel-qcow2-util-linux-6f1507f135bce5ba7f318c44e05327ca14a0505a.tar.xz kernel-qcow2-util-linux-6f1507f135bce5ba7f318c44e05327ca14a0505a.zip |
wipefs: exit on failed erase
The current behavior is to report error and continue, it seems strange:
# blockdev --setro /dev/sdc
# wipefs -a /dev/sdc
wipefs: /dev/sdc: failed to erase xfs magic string at offset 0x00000000: Operation not permitted
/dev/sdc: 4 bytes were erased at offset 0x00000000 (xfs): 58 46 53 42
^^^^^^^^^^^
not true
The patch calls err() to exit.
Reported-by: Vratislav Podzimek <vpodzime@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils/wipefs.c')
-rw-r--r-- | misc-utils/wipefs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/misc-utils/wipefs.c b/misc-utils/wipefs.c index e07ce18e3..209ed7147 100644 --- a/misc-utils/wipefs.c +++ b/misc-utils/wipefs.c @@ -310,7 +310,7 @@ static void do_wipe_real(blkid_probe pr, const char *devname, size_t i; if (blkid_do_wipe(pr, (flags & WP_FL_NOACT) != 0)) - warn(_("%s: failed to erase %s magic string at offset 0x%08jx"), + err(EXIT_FAILURE, _("%s: failed to erase %s magic string at offset 0x%08jx"), devname, w->type, (intmax_t)w->offset); if (flags & WP_FL_QUIET) |