diff options
-rw-r--r-- | util-linux/mount.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/util-linux/mount.c b/util-linux/mount.c index 1ffed9dfd..9d87f766c 100644 --- a/util-linux/mount.c +++ b/util-linux/mount.c | |||
@@ -1598,6 +1598,8 @@ static int singlemount(struct mntent *mp, int ignore_busy) | |||
1598 | llist_t *fl = NULL; | 1598 | llist_t *fl = NULL; |
1599 | struct stat st; | 1599 | struct stat st; |
1600 | 1600 | ||
1601 | errno = 0; | ||
1602 | |||
1601 | vfsflags = parse_mount_options(mp->mnt_opts, &filteropts); | 1603 | vfsflags = parse_mount_options(mp->mnt_opts, &filteropts); |
1602 | 1604 | ||
1603 | // Treat fstype "auto" as unspecified | 1605 | // Treat fstype "auto" as unspecified |
@@ -1642,17 +1644,16 @@ static int singlemount(struct mntent *mp, int ignore_busy) | |||
1642 | int len; | 1644 | int len; |
1643 | char c; | 1645 | char c; |
1644 | len_and_sockaddr *lsa; | 1646 | len_and_sockaddr *lsa; |
1645 | char *ip, *dotted, *s; | 1647 | char *hostname, *dotted, *ip; |
1646 | 1648 | ||
1647 | s = mp->mnt_fsname + 2; | 1649 | hostname = mp->mnt_fsname + 2; |
1648 | len = strcspn(s, "/\\"); | 1650 | len = strcspn(hostname, "/\\"); |
1649 | s += len; // points after hostname | 1651 | if (len == 0 || hostname[len] == '\0') |
1650 | if (len == 0 || *s == '\0') | ||
1651 | goto report_error; | 1652 | goto report_error; |
1652 | c = *s; | 1653 | c = hostname[len]; |
1653 | *s = '\0'; | 1654 | hostname[len] = '\0'; |
1654 | lsa = host2sockaddr(s, 0); | 1655 | lsa = host2sockaddr(hostname, 0); |
1655 | *s = c; | 1656 | hostname[len] = c; |
1656 | if (!lsa) | 1657 | if (!lsa) |
1657 | goto report_error; | 1658 | goto report_error; |
1658 | 1659 | ||
@@ -1713,9 +1714,9 @@ static int singlemount(struct mntent *mp, int ignore_busy) | |||
1713 | // Loop through filesystem types until mount succeeds | 1714 | // Loop through filesystem types until mount succeeds |
1714 | // or we run out | 1715 | // or we run out |
1715 | 1716 | ||
1716 | // Initialize list of block backed filesystems. This has to be | 1717 | // Initialize list of block backed filesystems. |
1717 | // done here so that during "mount -a", mounts after /proc shows up | 1718 | // This has to be done here so that during "mount -a", |
1718 | // can autodetect. | 1719 | // mounts after /proc shows up can autodetect. |
1719 | if (!fslist) { | 1720 | if (!fslist) { |
1720 | fslist = get_block_backed_filesystems(); | 1721 | fslist = get_block_backed_filesystems(); |
1721 | if (ENABLE_FEATURE_CLEAN_UP && fslist) | 1722 | if (ENABLE_FEATURE_CLEAN_UP && fslist) |