void-packages/srcpkgs/dhcpcd-dbus/patches/musl-fcntl_h.patch

89 lines
1.8 KiB
Diff

The type ssize_t is required in the header, thus move
the include statements for system headers into dchpcd.h
Both glibc and musl libc have strverscmp(3) and the
static version would conflict with the musl libc one.
--- dhcpcd.h 2014-07-14 22:56:47.000000000 +0200
+++ dhcpcd.h 2015-10-11 09:57:47.605604457 +0200
@@ -28,6 +28,22 @@
#ifndef DHCPCD_H
#define DHCPCD_H
+// For strverscmp(3)
+#define _GNU_SOURCE
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+#include <sys/un.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdbool.h>
+#include <syslog.h>
+#include <unistd.h>
+
extern char *dhcpcd_version;
extern const char *dhcpcd_status;
--- dhcpcd.c 2014-07-14 22:56:47.000000000 +0200
+++ dhcpcd.c 2015-10-11 09:57:11.545607270 +0200
@@ -24,22 +24,6 @@
* SUCH DAMAGE.
*/
-// For strverscmp(3)
-#define _GNU_SOURCE
-
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <sys/un.h>
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <syslog.h>
-#include <unistd.h>
-
#include "defs.h"
#include "dhcpcd.h"
#include "dhcpcd-dbus.h"
@@ -648,31 +648,6 @@
return list;
}
-#ifndef __GLIBC__
-/* Good enough for our needs */
-static int
-strverscmp(const char *s1, const char *s2)
-{
- int s1maj, s1min, s1part;
- int s2maj, s2min, s2part;
- int r;
-
- s1min = s1part = 0;
- if (sscanf(s1, "%d.%d.%d", &s1maj, &s1min, &s1part) < 1)
- return -1;
- s2min = s2part = 0;
- if (sscanf(s2, "%d.%d.%d", &s2maj, &s2min, &s2part) < 1)
- return -1;
- r = s1maj - s2maj;
- if (r != 0)
- return r;
- r = s1min - s2min;
- if (r != 0)
- return r;
- return s1part - s2part;
-}
-#endif
-
void
dhcpcd_init(_unused void *data)
{