[patch-2.4.0-test7-pre6] bugfix in <linux/fs.h>

From: Tigran Aivazian (tigran@veritas.com)
Date: Tue Aug 22 2000 - 08:01:03 EST


Hi Linus,

The <linux/fs.h> contains BLKRRPART ioctl cmds so it can be legitimately
included by user application. However, if such also includes <string.h>
and specifies -O option then it will fail to compile because of
<linux/string.h>.

I think I sent you a fix for this many moons ago but it somehow got
lost. Anyway, here it is again.

Regards,
Tigran

--- linux/include/linux/fs.h Tue Aug 22 08:22:17 2000
+++ work/include/linux/fs.h Tue Aug 22 13:53:26 2000
@@ -20,7 +20,10 @@
 #include <linux/stat.h>
 #include <linux/cache.h>
 #include <linux/stddef.h>
+
+#ifdef __KERNEL__
 #include <linux/string.h>
+#endif
 
 #include <asm/atomic.h>
 #include <asm/bitops.h>

Alternatively, I know that you don't like seeing __KERNEL__ so we can hide
it inside <linux/string.h> - both patches tested under test7-pre6

--- linux/include/linux/string.h Sat May 13 09:32:41 2000
+++ work/include/linux/string.h Tue Aug 22 13:59:51 2000
@@ -1,6 +1,8 @@
 #ifndef _LINUX_STRING_H_
 #define _LINUX_STRING_H_
 
+#ifdef __KERNEL__ /* userspace has no business here */
+
 #include <linux/types.h> /* for size_t */
 #include <linux/stddef.h> /* for NULL */
 
@@ -79,5 +81,7 @@
 #ifdef __cplusplus
 }
 #endif
+
+#endif /* __KERNEL__ */
 
 #endif /* _LINUX_STRING_H_ */

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Aug 23 2000 - 21:00:06 EST