OSDN Git Service

[GCC4] fix build error in drivers/sound/wavfront.c
authorWilly Tarreau <w@1wt.eu>
Sun, 13 Aug 2006 14:00:26 +0000 (16:00 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 13 Aug 2006 15:19:27 +0000 (17:19 +0200)
This patch fixes this error with gcc 4 :

wavfront.c:2490: error: static declaration of 'errno' follows non-static declaration
/usr/src/git/linux-2.4/include/linux/unistd.h:4: error: previous declaration of 'errno' was here

The solution is to workaround errno the same way as in sound_firmware :

drivers/sound/wavfront.c

index 632e731..92fcb20 100644 (file)
@@ -2484,11 +2484,11 @@ static int __init detect_wavefront (int irq, int io_base)
 #include <linux/fs.h>
 #include <linux/mm.h>
 #include <linux/slab.h>
-#include <linux/unistd.h>
+static int my_errno;
+#define errno my_errno
+#include <asm/unistd.h>
 #include <asm/uaccess.h>
 
-static int errno; 
-
 static int
 wavefront_download_firmware (char *path)