Module Name: src
Committed By: mouse
Date: Thu Aug 27 07:28:42 UTC 2009
Modified Files:
src/sys/sys: stat.h
Log Message:
Parenthesize S_IS*() macro arguments to prevent breakage with certain
arguments - see PR 41919. Approved by dholland.
To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/sys/stat.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/sys/stat.h
diff -u src/sys/sys/stat.h:1.58 src/sys/sys/stat.h:1.59
--- src/sys/sys/stat.h:1.58 Sun Jan 11 02:45:55 2009
+++ src/sys/sys/stat.h Thu Aug 27 07:28:42 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: stat.h,v 1.58 2009/01/11 02:45:55 christos Exp $ */
+/* $NetBSD: stat.h,v 1.59 2009/08/27 07:28:42 mouse Exp $ */
/*-
* Copyright (c) 1982, 1986, 1989, 1993
@@ -148,21 +148,21 @@
#define S_ARCH2 _S_ARCH2
#endif
-#define S_ISDIR(m) ((m & _S_IFMT) == _S_IFDIR) /* directory */
-#define S_ISCHR(m) ((m & _S_IFMT) == _S_IFCHR) /* char special */
-#define S_ISBLK(m) ((m & _S_IFMT) == _S_IFBLK) /* block special */
-#define S_ISREG(m) ((m & _S_IFMT) == _S_IFREG) /* regular file */
-#define S_ISFIFO(m) ((m & _S_IFMT) == _S_IFIFO) /* fifo */
+#define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR) /* directory */
+#define S_ISCHR(m) (((m) & _S_IFMT) == _S_IFCHR) /* char special */
+#define S_ISBLK(m) (((m) & _S_IFMT) == _S_IFBLK) /* block special */
+#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG) /* regular file */
+#define S_ISFIFO(m) (((m) & _S_IFMT) == _S_IFIFO) /* fifo */
#if ((_POSIX_C_SOURCE - 0) >= 200112L) || defined(_XOPEN_SOURCE) || \
defined(_NETBSD_SOURCE)
-#define S_ISLNK(m) ((m & _S_IFMT) == _S_IFLNK) /* symbolic link */
+#define S_ISLNK(m) (((m) & _S_IFMT) == _S_IFLNK) /* symbolic link */
#endif
#if ((_POSIX_C_SOURCE - 0) >= 200112L) || ((_XOPEN_SOURCE - 0) >= 600) || \
defined(_NETBSD_SOURCE)
-#define S_ISSOCK(m) ((m & _S_IFMT) == _S_IFSOCK) /* socket */
+#define S_ISSOCK(m) (((m) & _S_IFMT) == _S_IFSOCK) /* socket */
#endif
#if defined(_NETBSD_SOURCE)
-#define S_ISWHT(m) ((m & _S_IFMT) == _S_IFWHT) /* whiteout */
+#define S_ISWHT(m) (((m) & _S_IFMT) == _S_IFWHT) /* whiteout */
#endif
#if defined(_NETBSD_SOURCE)