1From 50e6b3a0fc7c083e6514a55ac93e5591aaeb787d Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 19 Nov 2015 00:10:03 +0000
4Subject: [PATCH] Fix build on musl use realpath() API its available on all
5 libcs
6
7realpath() API doesnt work on systems with PATH_MAX set to be unlimited e.g. GNU/Hurd
8However for Linux it should always work
9
10Upstream-Status: Inappropriate [Linux specific]
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 src/killall5.c   | 4 ++--
15 src/mountpoint.c | 1 +
16 src/wall.c       | 1 +
17 3 files changed, 4 insertions(+), 2 deletions(-)
18
19diff --git a/src/killall5.c b/src/killall5.c
20index 34d656b..bc19d7f 100644
21--- a/src/killall5.c
22+++ b/src/killall5.c
23@@ -910,9 +910,9 @@ int matches(PROC *o, PROC *p)
24 	char *oargv1, *pargv1;
25 	if ((o->argv0 && p->argv0 && !strcmp(o->argv0,p->argv0))) {
26 		if (o->argv1 && p->argv1) {
27-			if ((oargv1 = canonicalize_file_name(o->argv1)) == NULL)
28+			if ((oargv1 = realpath(o->argv1, NULL)) == NULL)
29 				oargv1 = strdup(o->argv1);
30-			if ((pargv1 = canonicalize_file_name(p->argv1)) == NULL)
31+			if ((pargv1 = realpath(p->argv1, NULL)) == NULL)
32 				pargv1 = strdup(p->argv1);
33 			if (! strcmp(oargv1, pargv1)) {
34 				ret = 1;
35diff --git a/src/mountpoint.c b/src/mountpoint.c
36index 184b1f6..c55b0df 100644
37--- a/src/mountpoint.c
38+++ b/src/mountpoint.c
39@@ -23,6 +23,7 @@
40  *		Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
41  */
42
43+#include <sys/types.h>
44 #include <sys/stat.h>
45 #include <unistd.h>
46 #include <stdlib.h>
47diff --git a/src/wall.c b/src/wall.c
48index e527613..1d363ca 100644
49--- a/src/wall.c
50+++ b/src/wall.c
51@@ -30,6 +30,7 @@
52 #include <pwd.h>
53 #include <syslog.h>
54 #include <sys/types.h>
55+#include <time.h>
56 #include "init.h"
57
58
59--
602.25.1
61
62