summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/sysvinit/sysvinit/realpath.patch
blob: b559aa3b490617992a0eb9bec7afbe4f585cf3d0 (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
52
53
54
55
56
57
58
59
From eb158c97f19d473d01befe96359a7f93ae834517 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 19 Nov 2015 00:10:03 +0000
Subject: [PATCH] Fix build on musl use realpath() API its available on all
 libcs

realpath() API doesnt work on systems with PATH_MAX set to be unlimited e.g. GNU/Hurd
However for Linux it should always work

Upstream-Status: Inappropriate [Linux specific]

Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 src/killall5.c   | 4 ++--
 src/mountpoint.c | 1 +
 src/wall.c       | 1 +
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/killall5.c b/src/killall5.c
index a664954..9798423 100644
--- a/src/killall5.c
+++ b/src/killall5.c
@@ -977,9 +977,9 @@ int matches(PROC *o, PROC *p)
 	char *oargv1, *pargv1;
 	if ((o->argv0 && p->argv0 && !strcmp(o->argv0,p->argv0))) {
 		if (o->argv1 && p->argv1) {
-			if ((oargv1 = canonicalize_file_name(o->argv1)) == NULL)
+			if ((oargv1 = realpath(o->argv1, NULL)) == NULL)
 				oargv1 = strdup(o->argv1);
-			if ((pargv1 = canonicalize_file_name(p->argv1)) == NULL)
+			if ((pargv1 = realpath(p->argv1, NULL)) == NULL)
 				pargv1 = strdup(p->argv1);
 			if (! strcmp(oargv1, pargv1)) {
 				ret = 1;
diff --git a/src/mountpoint.c b/src/mountpoint.c
index b24335e..5f20522 100644
--- a/src/mountpoint.c
+++ b/src/mountpoint.c
@@ -23,6 +23,7 @@
  *		Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
 #include <stdlib.h>
diff --git a/src/wall.c b/src/wall.c
index d3a2c70..00826e9 100644
--- a/src/wall.c
+++ b/src/wall.c
@@ -30,6 +30,7 @@
 #include <pwd.h>
 #include <syslog.h>
 #include <sys/types.h>
+#include <time.h>
 #include "init.h"