Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 1 | Fix build on musl use realpath() API its available on all libcs |
| 2 | |
| 3 | realpath() API doesnt work on systems with PATH_MAX set to be unlimited e.g. GNU/Hurd |
| 4 | However for Linux it should always work |
| 5 | |
| 6 | Upstream-Status: Inappropriate[Linux specific] |
| 7 | |
| 8 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 9 | |
| 10 | Index: sysvinit-2.88dsf/src/ifdown.c |
| 11 | =================================================================== |
| 12 | --- sysvinit-2.88dsf.orig/src/ifdown.c 2010-03-23 07:37:01.000000000 -0700 |
| 13 | +++ sysvinit-2.88dsf/src/ifdown.c 2014-04-02 00:43:43.675437029 -0700 |
| 14 | @@ -26,11 +26,11 @@ |
| 15 | #include <unistd.h> |
| 16 | #include <time.h> |
| 17 | #include <string.h> |
| 18 | +#include <errno.h> |
| 19 | |
| 20 | #include <sys/ioctl.h> |
| 21 | #include <sys/socket.h> |
| 22 | #include <sys/time.h> |
| 23 | -#include <sys/errno.h> |
| 24 | |
| 25 | #include <net/if.h> |
| 26 | #include <netinet/in.h> |
| 27 | Index: sysvinit-2.88dsf/src/init.c |
| 28 | =================================================================== |
| 29 | --- sysvinit-2.88dsf.orig/src/init.c 2014-04-02 00:42:10.488770162 -0700 |
| 30 | +++ sysvinit-2.88dsf/src/init.c 2014-04-02 00:42:59.432103823 -0700 |
| 31 | @@ -49,6 +49,7 @@ |
| 32 | #include <utmp.h> |
| 33 | #include <ctype.h> |
| 34 | #include <stdarg.h> |
| 35 | +#include <sys/ttydefaults.h> |
| 36 | #include <sys/syslog.h> |
| 37 | #include <sys/time.h> |
| 38 | |
| 39 | Index: sysvinit-2.88dsf/src/mountpoint.c |
| 40 | =================================================================== |
| 41 | --- sysvinit-2.88dsf.orig/src/mountpoint.c 2009-09-10 01:28:49.000000000 -0700 |
| 42 | +++ sysvinit-2.88dsf/src/mountpoint.c 2014-04-02 00:44:18.248770942 -0700 |
| 43 | @@ -23,6 +23,7 @@ |
| 44 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 45 | */ |
| 46 | |
| 47 | +#include <sys/types.h> |
| 48 | #include <sys/stat.h> |
| 49 | #include <unistd.h> |
| 50 | #include <stdlib.h> |
| 51 | Index: sysvinit-2.88dsf/src/killall5.c |
| 52 | =================================================================== |
| 53 | --- sysvinit-2.88dsf.orig/src/killall5.c 2014-03-26 00:49:52.982668074 -0700 |
| 54 | +++ sysvinit-2.88dsf/src/killall5.c 2014-04-02 00:46:45.838771653 -0700 |
| 55 | @@ -846,9 +846,9 @@ |
| 56 | char *oargv1, *pargv1; |
| 57 | if ((o->argv0 && p->argv0 && !strcmp(o->argv0,p->argv0))) { |
| 58 | if (o->argv1 && p->argv1) { |
| 59 | - if ((oargv1 = canonicalize_file_name(o->argv1)) == NULL) |
| 60 | + if ((oargv1 = realpath(o->argv1, NULL)) == NULL) |
| 61 | oargv1 = strdup(o->argv1); |
| 62 | - if ((pargv1 = canonicalize_file_name(p->argv1)) == NULL) |
| 63 | + if ((pargv1 = realpath(p->argv1, NULL)) == NULL) |
| 64 | pargv1 = strdup(p->argv1); |
| 65 | if (! strcmp(oargv1, pargv1)) { |
| 66 | ret = 1; |
| 67 | Index: sysvinit-2.88dsf/src/wall.c |
| 68 | =================================================================== |
| 69 | --- sysvinit-2.88dsf.orig/src/wall.c 2009-11-22 14:05:53.000000000 -0800 |
| 70 | +++ sysvinit-2.88dsf/src/wall.c 2014-04-02 00:49:15.258772217 -0700 |
| 71 | @@ -29,6 +29,7 @@ |
| 72 | #include <unistd.h> |
| 73 | #include <pwd.h> |
| 74 | #include <syslog.h> |
| 75 | +#include <time.h> |
| 76 | #include "init.h" |
| 77 | |
| 78 | |