Date: Sun, 25 Oct 2015 04:37:00 +0000 (UTC) From: Garrett Cooper <ngie@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289916 - head/sbin/camcontrol Message-ID: <201510250437.t9P4b0Yl097537@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ngie Date: Sun Oct 25 04:37:00 2015 New Revision: 289916 URL: https://svnweb.freebsd.org/changeset/base/289916 Log: Limit RESOLUTION_MAX to INT_MAX, not UINT_MAX (all spelled out) so the mode value isn't always clipped to -1 when (resolution * size) == 32, which would have been the case with values => {4i,32b,32t}. This seems to have been broken in r64382. MFC after: 1 week X-MFC with: r289915 PR: 200619 Reported by: Michael Baptist Submitted by: Lars Skodje Sponsored by: EMC / Isilon Storage Division Modified: head/sbin/camcontrol/modeedit.c Modified: head/sbin/camcontrol/modeedit.c ============================================================================== --- head/sbin/camcontrol/modeedit.c Sun Oct 25 04:04:25 2015 (r289915) +++ head/sbin/camcontrol/modeedit.c Sun Oct 25 04:37:00 2015 (r289916) @@ -246,7 +246,7 @@ editentry_set(char *name, char *newvalue * currently workaround it (even for int64's), so we have to kludge it. */ #define RESOLUTION_MAX(size) ((resolution * (size) == 32)? \ - (int)0xffffffff: (1 << (resolution * (size))) - 1) + INT_MAX: (1 << (resolution * (size))) - 1) assert(newvalue != NULL); if (*newvalue == '\0')
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510250437.t9P4b0Yl097537>