From owner-svn-src-all@FreeBSD.ORG Sun Mar 7 16:45:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D22C1065670; Sun, 7 Mar 2010 16:45:19 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CB968FC0C; Sun, 7 Mar 2010 16:45:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o27GjIdh004173; Sun, 7 Mar 2010 16:45:18 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o27GjIYs004171; Sun, 7 Mar 2010 16:45:18 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201003071645.o27GjIYs004171@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 7 Mar 2010 16:45:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204840 - head/sbin/mount X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2010 16:45:19 -0000 Author: bz Date: Sun Mar 7 16:45:18 2010 New Revision: 204840 URL: http://svn.freebsd.org/changeset/base/204840 Log: As statfs.f_flags are uint64_t the local variables should be as well. We'll start noticing this with the next flag introduced as the lower 32bit are all used. As this is old code we might need to do a full tree sweep one day, unless changing our strategy to use a different `API' for getting/setting flags along with the rest of the statfs data. While here compare to 0 explicitly [1]. Suggested by: kib [1] Reviewed by: kib MFC after: 5 days Modified: head/sbin/mount/mount.c Modified: head/sbin/mount/mount.c ============================================================================== --- head/sbin/mount/mount.c Sun Mar 7 16:24:33 2010 (r204839) +++ head/sbin/mount/mount.c Sun Mar 7 16:45:18 2010 (r204840) @@ -91,7 +91,7 @@ char *flags2opts(int); /* Map from mount options to printable formats. */ static struct opt { - int o_opt; + uint64_t o_opt; const char *o_name; } optnames[] = { { MNT_ASYNC, "asynchronous" }, @@ -612,7 +612,7 @@ mountfs(const char *vfstype, const char void prmount(struct statfs *sfp) { - int flags; + uint64_t flags; unsigned int i; struct opt *o; struct passwd *pw; @@ -621,7 +621,7 @@ prmount(struct statfs *sfp) sfp->f_fstypename); flags = sfp->f_flags & MNT_VISFLAGMASK; - for (o = optnames; flags && o->o_opt; o++) + for (o = optnames; flags != 0 && o->o_opt != 0; o++) if (flags & o->o_opt) { (void)printf(", %s", o->o_name); flags &= ~o->o_opt;