commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[hurd] 10/70: sutils: allow multiple entries for the device "none"


From: Samuel Thibault
Subject: [hurd] 10/70: sutils: allow multiple entries for the device "none"
Date: Mon, 16 Sep 2013 07:41:35 +0000

This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch upstream
in repository hurd.

commit cc96e7a24e8d6ab074ee9023c99cc6ff88fe9d06
Author: Justus Winter <address@hidden>
Date:   Fri Jul 5 17:13:31 2013 +0200

    sutils: allow multiple entries for the device "none"
    
    Previously it was not possible to add two mount entries with the same
    device information to an fstab structure. This is easily fixed by
    breaking the assumption, that there is only one possible mount entry
    for the "none" device as used by many purely virtual file systems.
    
    * utils/fstab.c (fstab_find_device): Return NULL if name is "none".
---
 sutils/fstab.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/sutils/fstab.c b/sutils/fstab.c
index 1492ccd..e2918a6 100644
--- a/sutils/fstab.c
+++ b/sutils/fstab.c
@@ -457,11 +457,19 @@ fs_remount (struct fs *fs)
   return err;
 }
 
-/* Returns the FS entry in FSTAB with the device field NAME (there can only
-   be one such entry).  */
+/* Returns the FS entry in FSTAB with the device field NAME.
+
+   In general there can only be one such entry. This holds not true
+   for virtual file systems that use "none" as device name.
+
+   If name is "none", NULL is returned. This also makes it possible to
+   add more than one entry for the device "none". */
 inline struct fs *
 fstab_find_device (const struct fstab *fstab, const char *name)
 {
+  if (strcmp (name, "none") == 0)
+    return NULL;
+
   struct fs *fs;
   for (fs = fstab->entries; fs; fs = fs->next)
     if (strcmp (fs->mntent.mnt_fsname, name) == 0)

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-hurd/hurd.git



reply via email to

[Prev in Thread] Current Thread [Next in Thread]