* Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
* Copyright (C) 2005-2006 by Rob Landley <rob@landley.net>
*
- * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
// Design notes: There is no spec for mount. Remind me to write one.
//
* Linux NFS mount
* Copyright (C) 1993 Rick Sladkey <jrs@world.std.com>
*
- * Licensed under GPLv2, see file LICENSE in this tarball for details.
+ * Licensed under GPLv2, see file LICENSE in this source tree.
*
* Wed Feb 8 12:51:48 1995, biro@yggdrasil.com (Ross Biro): allow all port
* numbers to be specified on the command line.
19, 20, 21, 22, 27, 28,
30, 63, 66, 69, 70, 71
};
-static const uint8_t nfs_err_errnum[] = {
+#if ( \
+ EPERM | ENOENT | EIO | ENXIO | EACCES| EEXIST | \
+ ENODEV| ENOTDIR | EISDIR | EINVAL| EFBIG | ENOSPC | \
+ EROFS | ENAMETOOLONG| ENOTEMPTY| EDQUOT| ESTALE| EREMOTE) < 256
+typedef uint8_t nfs_err_type;
+#else
+typedef uint16_t nfs_err_type;
+#endif
+static const nfs_err_type nfs_err_errnum[] = {
EPERM , ENOENT , EIO , ENXIO , EACCES, EEXIST,
ENODEV, ENOTDIR , EISDIR , EINVAL, EFBIG , ENOSPC,
EROFS , ENAMETOOLONG, ENOTEMPTY, EDQUOT, ESTALE, EREMOTE
continue;
}
- val = xatoi_u(opteq);
+ val = xatoi_positive(opteq);
switch (idx) {
case 0: // "rsize"
data.rsize = val;
// If we know the fstype (or don't need to), jump straight
// to the actual mount.
- if (mp->mnt_type || (vfsflags & (MS_REMOUNT | MS_BIND | MS_MOVE)))
+ if (mp->mnt_type || (vfsflags & (MS_REMOUNT | MS_BIND | MS_MOVE))) {
rc = mount_it_now(mp, vfsflags, filteropts);
- else {
+ } else {
// Loop through filesystem types until mount succeeds
// or we run out
if (errno == EBUSY && ignore_busy)
return 0;
- if (rc < 0)
+ if (rc != 0)
bb_perror_msg("mounting %s on %s failed", mp->mnt_fsname, mp->mnt_dir);
return rc;
}