Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2013-02-03 17:38:16 +01:00
parent fa5b149b5d
commit 8027d4fd80
3 changed files with 121 additions and 1 deletions

View File

@ -0,0 +1,30 @@
diff --git a/text-utils/parse.c b/text-utils/parse.c
index 5f1e2bd..bd96961 100644
--- a/text-utils/parse.c
+++ b/text-utils/parse.c
@@ -421,13 +421,15 @@ isint2: switch(fu->bcnt) {
!(fu->flags&F_SETREP) && fu->bcnt)
fu->reps += (blocksize - fs->bcnt) / fu->bcnt;
if (fu->reps > 1) {
- for (pr = fu->nextpr;; pr = pr->nextpr)
- if (!pr->nextpr)
- break;
- for (p1 = pr->fmt, p2 = NULL; *p1; ++p1)
- p2 = isspace((unsigned char)*p1) ? p1 : NULL;
- if (p2)
- pr->nospace = p2;
+ if (fu->nextpr) {
+ for (pr = fu->nextpr; ; pr = pr->nextpr)
+ if (!pr->nextpr)
+ break;
+ for (p1 = pr->fmt, p2 = NULL; *p1; ++p1)
+ p2 = isspace((unsigned char)*p1) ? p1 : NULL;
+ if (p2)
+ pr->nospace = p2;
+ }
}
}
}
--
1.8.1

View File

@ -0,0 +1,81 @@
diff -up util-linux-2.21.2/sys-utils/mount.c.orig util-linux-2.21.2/sys-utils/mount.c
--- util-linux-2.21.2/sys-utils/mount.c.orig 2013-02-03 17:33:05.248888432 +0100
+++ util-linux-2.21.2/sys-utils/mount.c 2013-02-03 17:34:31.856571865 +0100
@@ -238,6 +238,29 @@ static int mount_all(struct libmnt_conte
return rc;
}
+static void success_message(struct libmnt_context *cxt)
+{
+ unsigned long mflags = 0;
+ const char *tgt, *src;
+
+ if (mnt_context_helper_executed(cxt)
+ || mnt_context_get_status(cxt) != 1)
+ return;
+
+ mnt_context_get_mflags(cxt, &mflags);
+ tgt = mnt_context_get_target(cxt);
+ src = mnt_context_get_source(cxt);
+
+ if (mflags & MS_MOVE)
+ warnx(_("%s moved to %s"), src, tgt);
+ else if (mflags & MS_BIND)
+ warnx(_("%s binded on %s"), src, tgt);
+ else if (mflags & MS_PROPAGATION)
+ warnx(_("%s propagation flags changed"), tgt);
+ else
+ warnx(_("%s mounted on %s"), src, tgt);
+}
+
/*
* Handles generic errors like ENOMEM, ...
*
@@ -913,6 +936,8 @@ int main(int argc, char **argv)
rc = mnt_context_mount(cxt);
rc = mk_exit_code(cxt, rc);
+ if (rc == MOUNT_EX_SUCCESS && mnt_context_is_verbose(cxt))
+ success_message(cxt);
done:
free(srcbuf);
mnt_free_context(cxt);
diff -up util-linux-2.21.2/sys-utils/umount.c.orig util-linux-2.21.2/sys-utils/umount.c
--- util-linux-2.21.2/sys-utils/umount.c.orig 2012-05-25 11:44:59.043195664 +0200
+++ util-linux-2.21.2/sys-utils/umount.c 2013-02-03 17:33:05.266888574 +0100
@@ -119,6 +119,25 @@ static void __attribute__((__noreturn__)
errx(MOUNT_EX_USAGE, _("only root can do that"));
}
+static void success_message(struct libmnt_context *cxt)
+{
+ const char *tgt, *src;
+
+ if (mnt_context_helper_executed(cxt)
+ || mnt_context_get_status(cxt) != 1)
+ return;
+
+ tgt = mnt_context_get_target(cxt);
+ if (!tgt)
+ return;
+
+ src = mnt_context_get_source(cxt);
+ if (src)
+ warnx(_("%s (%s) unmounted"), tgt, src);
+ else
+ warnx(_("%s unmounted"), tgt);
+}
+
/*
* Handles generic errors like ENOMEM, ...
*
@@ -273,6 +292,9 @@ static int umount_one(struct libmnt_cont
rc = mnt_context_umount(cxt);
rc = mk_exit_code(cxt, rc);
+ if (rc == MOUNT_EX_SUCCESS && mnt_context_is_verbose(cxt))
+ success_message(cxt);
+
mnt_reset_context(cxt);
return rc;
}

View File

@ -2,7 +2,7 @@
Summary: A collection of basic system utilities
Name: util-linux
Version: 2.21.2
Release: 3%{?dist}
Release: 4%{?dist}
License: GPLv2 and GPLv2+ and GPLv3+ and LGPLv2+ and BSD with advertising and Public Domain
Group: System Environment/Base
URL: http://kernel.org/~kzak/util-linux/
@ -87,6 +87,11 @@ Patch6: util-linux-2.21-uuidd-rundir.patch
Patch7: util-linux-2.21-mount-commas.patch
# 875461 - read_topology: Process /usr/bin/lscpu was killed by signal 8 (SIGFPE)
Patch8: util-linux-2.21-lscpu-SIGFPE.patch
# 885314 - hexdump segfault
Patch9: hexdump-do-not-segfault-when-iterating-over-an-empty.patch
# 864227 - mount option -v or --verbose does not work
Patch10: mount-add-verbose-messages.patch
%description
The util-linux package contains a large variety of low-level system
@ -719,6 +724,10 @@ fi
%changelog
* Sun Feb 3 2013 Karel Zak <kzak@redhat.com> 2.21.2-4
- fix #885314 - hexdump segfault
- fix #864227 - mount option -v or --verbose does not work
* Fri Nov 16 2012 Karel Zak <kzak@redhat.com> 2.21.2-3
- fix #873983 - mount: /dev/mapper/myvg-usrlv is already mounted or /usr busy
- fix #875461 - read_topology: Process /usr/bin/lscpu was killed by signal 8 (SIGFPE)