diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2012-07-01 02:12:43 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2012-07-01 02:12:43 +0000 |
commit | 13ea39a34766fcbecd96ab94bcdf798b08e9bb60 (patch) | |
tree | 1e1463b03838a6f36868a4dafc7e652358a51857 /sutils | |
parent | 1f8d504f631531c199d7c6154a0dc442d80ea4a7 (diff) | |
parent | 7e15f3d69a83a34ac62cbbee944a0bfbfa92724e (diff) |
Merge branch 'master' into xkb
Conflicts:
config.make.in
configure.in
Diffstat (limited to 'sutils')
-rw-r--r-- | sutils/clookup.c | 2 | ||||
-rwxr-xr-x | sutils/e2os.sh | 4 | ||||
-rw-r--r-- | sutils/fsck.c | 2 | ||||
-rw-r--r-- | sutils/fstab.c | 26 |
4 files changed, 28 insertions, 6 deletions
diff --git a/sutils/clookup.c b/sutils/clookup.c index 8fe015e1..0107799c 100644 --- a/sutils/clookup.c +++ b/sutils/clookup.c @@ -36,7 +36,7 @@ any passive translators. If a node with an unstarted passive translator is encountered, ENXIO is returned in ERRNO; other errors are as for file_name_lookup. Note that checking for an active translator currently - requires fetching the control port, which is a priveleged operation. */ + requires fetching the control port, which is a privileged operation. */ file_t file_name_lookup_carefully (const char *name, int flags, mode_t mode) { diff --git a/sutils/e2os.sh b/sutils/e2os.sh index 10fe5087..60c9e017 100755 --- a/sutils/e2os.sh +++ b/sutils/e2os.sh @@ -93,7 +93,7 @@ $DD 2>"$ERRS" if="$DEVICE" of="$SB" bs=1k skip=1 count=1 \ # Extract a word of SZ bytes from byte offset POS in the superblock # Optional arg FMT is what format to use (x = hex, d = decimal) -function sbget +sbget () { local pos="$1" sz="$2" fmt="${3-d}" pos=$(($pos / $sz)) @@ -103,7 +103,7 @@ function sbget } # Set a word of SZ bytes at byte offset POS in the superblock to VAL -function sbset +sbset () { local pos="$1" sz="$2" val="$3" pos=$(($pos / $sz)) diff --git a/sutils/fsck.c b/sutils/fsck.c index 424e3f17..1ab9caa5 100644 --- a/sutils/fsck.c +++ b/sutils/fsck.c @@ -41,7 +41,7 @@ Although it knows something about the hurd, this fsck still uses /etc/fstab, and is generally not very integrated. That will have to wait - until the appropiate mechanisms for doing so are decided. */ + until the appropriate mechanisms for doing so are decided. */ #include <stdlib.h> #include <string.h> diff --git a/sutils/fstab.c b/sutils/fstab.c index e40572e2..b66e5195 100644 --- a/sutils/fstab.c +++ b/sutils/fstab.c @@ -497,7 +497,29 @@ fstab_find_mount (const struct fstab *fstab, const char *name) inline struct fs * fstab_find (const struct fstab *fstab, const char *name) { - return fstab_find_device (fstab, name) ?: fstab_find_mount (fstab, name); + struct fs *ret; + const char *real_name; + + ret = fstab_find_device (fstab, name); + if (ret) + return ret; + + ret = fstab_find_mount (fstab, name); + if (ret) + return ret; + + real_name = realpath (name, NULL); + + ret = fstab_find_device (fstab, real_name); + if (ret) { + free (real_name); + return ret; + } + + ret = fstab_find_mount (fstab, real_name); + free (real_name); + + return ret; } /* Cons FS onto the beginning of FSTAB's entry list. */ @@ -571,7 +593,7 @@ fstab_add_mntent (struct fstab *const fstab, const struct mntent *mntent, free (fs); } - if (!err && mounted_fs) + if (!err && mounted_fs && mounted_fs != fs) /* Get rid of the conflicting entry MOUNTED_FS. */ fs_free (mounted_fs); |