summaryrefslogtreecommitdiffstats
path: root/sbin/mksnap_ffs
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/mksnap_ffs')
-rw-r--r--sbin/mksnap_ffs/mksnap_ffs.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sbin/mksnap_ffs/mksnap_ffs.c b/sbin/mksnap_ffs/mksnap_ffs.c
index f0db853..7dcf5c2 100644
--- a/sbin/mksnap_ffs/mksnap_ffs.c
+++ b/sbin/mksnap_ffs/mksnap_ffs.c
@@ -121,8 +121,12 @@ main(int argc, char **argv)
build_iovec(&iov, &iovlen, "update", NULL, 0);
build_iovec(&iov, &iovlen, "snapshot", NULL, 0);
- if (nmount(iov, iovlen, stfsbuf.f_flags) < 0)
- err(1, "Cannot create snapshot %s: %s", snapname, errmsg);
+ *errmsg = '\0';
+ if (nmount(iov, iovlen, stfsbuf.f_flags) < 0) {
+ errmsg[sizeof(errmsg) - 1] = '\0';
+ err(1, "Cannot create snapshot %s%s%s", snapname,
+ *errmsg != '\0' ? ": " : "", errmsg);
+ }
if ((fd = open(snapname, O_RDONLY)) < 0)
err(1, "Cannot open %s", snapname);
if (fstat(fd, &stbuf) != 0)
OpenPOWER on IntegriCloud