diff options
author | Ruediger Meier | 2016-02-18 03:07:23 +0100 |
---|---|---|
committer | Ruediger Meier | 2016-03-07 21:25:36 +0100 |
commit | 8acff75afc900972a071eae7a3e5e5a1704e099d (patch) | |
tree | 9f222e8fd298bb1b338557f5bbff1ee84ded4f96 /misc-utils/wipefs.c | |
parent | Merge branch 'master' of https://github.com/Rufflewind/util-linux (diff) | |
download | kernel-qcow2-util-linux-8acff75afc900972a071eae7a3e5e5a1704e099d.tar.gz kernel-qcow2-util-linux-8acff75afc900972a071eae7a3e5e5a1704e099d.tar.xz kernel-qcow2-util-linux-8acff75afc900972a071eae7a3e5e5a1704e099d.zip |
wipefs, sfdisk: include libgen.h for basename(3p)
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'misc-utils/wipefs.c')
-rw-r--r-- | misc-utils/wipefs.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/misc-utils/wipefs.c b/misc-utils/wipefs.c index 594894447..abcf5ebe3 100644 --- a/misc-utils/wipefs.c +++ b/misc-utils/wipefs.c @@ -29,6 +29,7 @@ #include <getopt.h> #include <string.h> #include <limits.h> +#include <libgen.h> #include <blkid.h> @@ -378,9 +379,12 @@ do_wipe(struct wipe_desc *wp, const char *devname, int flags) if (zap && (flags & WP_FL_BACKUP)) { const char *home = getenv ("HOME"); + char *tmp = xstrdup(devname); + if (!home) errx(EXIT_FAILURE, _("failed to create a signature backup, $HOME undefined")); - xasprintf (&backup, "%s/wipefs-%s-", home, basename(devname)); + xasprintf (&backup, "%s/wipefs-%s-", home, basename(tmp)); + free(tmp); } wp0 = clone_offset(wp); |