summaryrefslogtreecommitdiffstats
path: root/main/mg/musl-fixes.patch
blob: b098d5352683a0d55682f84240dfe7cc72e0d737 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
--- mg-20110905.orig/fileio.c
+++ mg-20110905/fileio.c
@@ -570,7 +570,7 @@
 #if defined (__CYGWIN__)	/* Cygwin lacks reclen/namlen. */
 		if (strlen(dent->d_name) < len
 		    || memcmp(cp, dent->d_name, len) != 0)
-#elif defined (__GLIBC__)		/* Linux uses reclen instead. */
+#elif defined (__linux__)		/* Linux uses reclen instead. */
 		if (dent->d_reclen < len || memcmp(cp, dent->d_name, len) != 0)
 #else
 		if (dent->d_namlen < len || memcmp(cp, dent->d_name, len) != 0)
--- mg-20110905.orig/sysdef.h
+++ mg-20110905/sysdef.h
@@ -20,15 +20,13 @@
 
 /* necesarry to get asprintf & friends with glibc XXX doesn't work for some
  * mysterious reason! */
-#ifdef __GLIBC__
-#  define _GNU_SOURCE
-#  define __USE_GNU
-#endif
+#define _GNU_SOURCE
 #include <stdio.h>
 
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
+#include <fcntl.h>
 #include <errno.h>
 #include <signal.h>
 
--- mg-20110905.orig/theo.c
+++ mg-20110905/theo.c
@@ -218,14 +218,14 @@
 {
 	const char	*str;
 	int		 len;
-	uint             random;
+	unsigned int     random;
 #ifndef HAVE_ARC4RANDOM
 	struct timeval	tv[2];
 
 	gettimeofday(&tv[0], NULL);
-	random = (uint)tv[0].tv_usec;
+	random = (unsigned int)tv[0].tv_usec;
 #else
-	random = (uint)arc4random();
+	random = (unsigned int)arc4random();
 #endif
 
 	str = talk[random % ntalk];