[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 06/70: mount: fix mount -oremount with one parameter
From: |
Samuel Thibault |
Subject: |
[hurd] 06/70: mount: fix mount -oremount with one parameter |
Date: |
Mon, 16 Sep 2013 07:41:34 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 7cf9f75795a4e08519808db380cfffb535127d8c
Author: Justus Winter <address@hidden>
Date: Fri Jun 28 18:46:05 2013 +0200
mount: fix mount -oremount with one parameter
This fixes mount -oremount when just given the mountpoint, e. g.:
% mount -oremount,ro /tmp
* util/mount.c (main): Add a one-argument form for remount.
---
utils/mount.c | 29 +++++++++++++++++++++++------
1 file changed, 23 insertions(+), 6 deletions(-)
diff --git a/utils/mount.c b/utils/mount.c
index ea30f7a..f1d5750 100644
--- a/utils/mount.c
+++ b/utils/mount.c
@@ -526,6 +526,12 @@ main (int argc, char **argv)
fstab = fstab_argp_create (&fstab_params, SEARCH_FMTS, sizeof SEARCH_FMTS);
+ /* This is a convenient way of checking for any `remount' options. */
+ remount = 0;
+ err = argz_replace (&options, &options_len, "remount", "update", &remount);
+ if (err)
+ error (3, ENOMEM, "collecting mount options");
+
if (device) /* two-argument form */
{
struct mntent m =
@@ -548,6 +554,23 @@ main (int argc, char **argv)
if (err)
error (2, err, "%s", mountpoint);
}
+ else if (mountpoint && remount) /* one-argument remount */
+ {
+ struct mntent m =
+ {
+ mnt_fsname: mountpoint, /* since we cannot know the device,
+ using mountpoint here leads to more
+ helpful error messages */
+ mnt_dir: mountpoint,
+ mnt_type: fstype,
+ mnt_opts: 0,
+ mnt_freq: 0, mnt_passno: 0
+ };
+
+ err = fstab_add_mntent (fstab, &m, &fs);
+ if (err)
+ error (2, err, "%s", mountpoint);
+ }
else if (mountpoint) /* one-argument form */
{
fs = fstab_find (fstab, mountpoint);
@@ -557,12 +580,6 @@ main (int argc, char **argv)
else
fs = 0;
- /* This is a convenient way of checking for any `remount' options. */
- remount = 0;
- err = argz_replace (&options, &options_len, "remount", "update", &remount);
- if (err)
- error (3, ENOMEM, "collecting mount options");
-
if (fs != 0)
err = do_mount (fs, remount);
else
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 52/70: libdiskfs: track file name in struct peropen, (continued)
- [hurd] 52/70: libdiskfs: track file name in struct peropen, Samuel Thibault, 2013/09/16
- [hurd] 50/70: proc: Remove unused declaration of zombie_list, Samuel Thibault, 2013/09/16
- [hurd] 31/70: Merge branch 'master-merge2' into master-merge, Samuel Thibault, 2013/09/16
- [hurd] 12/70: umount: add a umount utility, Samuel Thibault, 2013/09/16
- [hurd] 10/70: sutils: allow multiple entries for the device "none", Samuel Thibault, 2013/09/16
- [hurd] 08/70: mount: implement -O, --test-opts, Samuel Thibault, 2013/09/16
- [hurd] 07/70: mount: add -f and --fake arguments, Samuel Thibault, 2013/09/16
- [hurd] 11/70: sutils: fix the semantic of -t, --types in fstab.c, Samuel Thibault, 2013/09/16
- [hurd] 42/70: trans: register symlink translators as important, Samuel Thibault, 2013/09/16
- [hurd] 33/70: Reserve RPC ID for proc_set_init_task, Samuel Thibault, 2013/09/16
- [hurd] 06/70: mount: fix mount -oremount with one parameter,
Samuel Thibault <=
- [hurd] 04/70: utils: escape arguments in remap.sh, Samuel Thibault, 2013/09/16
- [hurd] 30/70: umount: add a umount utility, Samuel Thibault, 2013/09/16
- [hurd] 32/70: Merge branch 'master-merge', Samuel Thibault, 2013/09/16
- [hurd] 28/70: libnetfs: implement file_get_translator_cntl, Samuel Thibault, 2013/09/16
- [hurd] 02/70: Fix polling pfinet tun for write, Samuel Thibault, 2013/09/16
- [hurd] 69/70: Large store support for ext2fs, Samuel Thibault, 2013/09/16
- [hurd] 01/70: config.make: Use more configure settings when building xkb-data, Samuel Thibault, 2013/09/16
- [hurd] 09/70: mount: ignore mounted filesystems if --all is given, Samuel Thibault, 2013/09/16
- [hurd] 05/70: mount: add -n and --no-mtab arguments, Samuel Thibault, 2013/09/16
- [hurd] 29/70: libnetfs: handle dead-name notifications, Samuel Thibault, 2013/09/16