summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2005-11-23 22:33:06 +0000
committerAlan Coopersmith <alan.coopersmith@sun.com>2005-11-23 22:33:06 +0000
commit8d1500df66d796ebff2b0d8c02205e5fa6796d4a (patch)
tree185167b96749074074750b9c179167910390b4c4
parent93cf3747f9ae8d30bd485b41c5ff10397f68f078 (diff)
Bug #5003 <https://bugs.freedesktop.org/show_bug.cgi?id=5003> Patch #3763 <https://bugs.freedesktop.org/attachment.cgi?id=3763> Xorg code misuses S_IF* macrosXORG-6_8_99_903
-rw-r--r--src/xkb/XKBCvt.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/xkb/XKBCvt.c b/src/xkb/XKBCvt.c
index 1369727..1bdf81c 100644
--- a/src/xkb/XKBCvt.c
+++ b/src/xkb/XKBCvt.c
@@ -274,7 +274,12 @@ _XkbGetCharset()
#else
char *cf = __XOS2RedirRoot(CHARSET_FILE);
#endif
- if ( (stat(cf,&sbuf)==0) && (sbuf.st_mode&S_IFREG) &&
+
+#ifndef S_ISREG
+# define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
+#endif
+
+ if ( (stat(cf,&sbuf)==0) && S_ISREG(sbuf.st_mode) &&
(file = fopen(cf,"r")) ) {
tmp = _XkbAlloc(sbuf.st_size+1);
if (tmp!=NULL) {