summaryrefslogtreecommitdiffstats
path: root/utils/mount/stropts.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2010-10-28 13:09:38 -0400
committerSteve Dickson <steved@redhat.com>2010-11-01 08:05:14 -0400
commit1f237ac72e6f563908b350e11fd2bb866c003028 (patch)
treebd9fc614d2331ffed1cf5993639f23836d66d863 /utils/mount/stropts.c
parent1ea2c3be33f2eb4630c5cdb78edf2bb670b294ab (diff)
downloadnfs-utils-1f237ac72e6f563908b350e11fd2bb866c003028.tar.gz
nfs-utils-1f237ac72e6f563908b350e11fd2bb866c003028.tar.xz
nfs-utils-1f237ac72e6f563908b350e11fd2bb866c003028.zip
mount: Fix compiler warning in nfs_parse_retry_option()
stropts.c: In function nfs_parse_retry_option: stropts.c:131: warning: conversion to unsigned int from long int may alter its value Make it more clear what the second argument is for, and flag the switch fallthrough case. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/mount/stropts.c')
-rw-r--r--utils/mount/stropts.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index bcc36f3..29b1aaa 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -119,10 +119,12 @@ inline void nfs_default_version(struct nfsmount_info *mi) {}
* Returns a time_t timeout timestamp, in seconds.
*/
static time_t nfs_parse_retry_option(struct mount_options *options,
- unsigned int timeout_minutes)
+ const time_t default_timeout)
{
+ time_t timeout_minutes;
long tmp;
+ timeout_minutes = default_timeout;
switch (po_get_numeric(options, "retry", &tmp)) {
case PO_NOT_FOUND:
break;
@@ -131,6 +133,7 @@ static time_t nfs_parse_retry_option(struct mount_options *options,
timeout_minutes = tmp;
break;
}
+ /*FALLTHROUGH*/
case PO_BAD_VALUE:
if (verbose)
nfs_error(_("%s: invalid retry timeout was specified; "
@@ -138,7 +141,7 @@ static time_t nfs_parse_retry_option(struct mount_options *options,
break;
}
- return time(NULL) + (time_t)(timeout_minutes * 60);
+ return time(NULL) + (timeout_minutes * 60);
}
/*