mirror of
https://github.com/sheumann/hush.git
synced 2025-02-19 05:30:56 +00:00
mount: fix goof in last commit; clear errno since we use perror_msg later
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
cb37637b47
commit
b7a0e13d1c
@ -1598,6 +1598,8 @@ static int singlemount(struct mntent *mp, int ignore_busy)
|
|||||||
llist_t *fl = NULL;
|
llist_t *fl = NULL;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
|
||||||
|
errno = 0;
|
||||||
|
|
||||||
vfsflags = parse_mount_options(mp->mnt_opts, &filteropts);
|
vfsflags = parse_mount_options(mp->mnt_opts, &filteropts);
|
||||||
|
|
||||||
// Treat fstype "auto" as unspecified
|
// Treat fstype "auto" as unspecified
|
||||||
@ -1642,17 +1644,16 @@ static int singlemount(struct mntent *mp, int ignore_busy)
|
|||||||
int len;
|
int len;
|
||||||
char c;
|
char c;
|
||||||
len_and_sockaddr *lsa;
|
len_and_sockaddr *lsa;
|
||||||
char *ip, *dotted, *s;
|
char *hostname, *dotted, *ip;
|
||||||
|
|
||||||
s = mp->mnt_fsname + 2;
|
hostname = mp->mnt_fsname + 2;
|
||||||
len = strcspn(s, "/\\");
|
len = strcspn(hostname, "/\\");
|
||||||
s += len; // points after hostname
|
if (len == 0 || hostname[len] == '\0')
|
||||||
if (len == 0 || *s == '\0')
|
|
||||||
goto report_error;
|
goto report_error;
|
||||||
c = *s;
|
c = hostname[len];
|
||||||
*s = '\0';
|
hostname[len] = '\0';
|
||||||
lsa = host2sockaddr(s, 0);
|
lsa = host2sockaddr(hostname, 0);
|
||||||
*s = c;
|
hostname[len] = c;
|
||||||
if (!lsa)
|
if (!lsa)
|
||||||
goto report_error;
|
goto report_error;
|
||||||
|
|
||||||
@ -1713,9 +1714,9 @@ static int singlemount(struct mntent *mp, int ignore_busy)
|
|||||||
// Loop through filesystem types until mount succeeds
|
// Loop through filesystem types until mount succeeds
|
||||||
// or we run out
|
// or we run out
|
||||||
|
|
||||||
// Initialize list of block backed filesystems. This has to be
|
// Initialize list of block backed filesystems.
|
||||||
// done here so that during "mount -a", mounts after /proc shows up
|
// This has to be done here so that during "mount -a",
|
||||||
// can autodetect.
|
// mounts after /proc shows up can autodetect.
|
||||||
if (!fslist) {
|
if (!fslist) {
|
||||||
fslist = get_block_backed_filesystems();
|
fslist = get_block_backed_filesystems();
|
||||||
if (ENABLE_FEATURE_CLEAN_UP && fslist)
|
if (ENABLE_FEATURE_CLEAN_UP && fslist)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user