vdr: fix dependency for libintl
[openembedded.git] / recipes / busybox / busybox-1.2.2 / udhcppidfile-breakage.patch
blob031274908bc13f18dfd297e30f7496cbf0cbf279
1 --- busybox-1.00/networking/udhcp/common.c~udhcppidfile2
2 +++ busybox-1.00/networking/udhcp/common.c
3 @@ -74,7 +74,7 @@
5 if (pid > 0) {
6 /* parent */
7 - if (pidfile_reassign(pidfile, pid) < 0) {
8 + if (pidfile != NULL && pidfile_reassign(pidfile, pid) < 0) {
9 (void)kill(pid, SIGKILL);
10 exit(1);
11 } else
12 @@ -119,7 +119,7 @@
13 sanitize_fds();
15 /* do some other misc startup stuff while we are here to save bytes */
16 - if (pidfile_acquire(pidfile) < 0)
17 + if (pidfile != NULL && pidfile_acquire(pidfile) < 0)
18 exit(1);
20 /* equivelent of doing a fflush after every \n */
21 @@ -166,7 +166,7 @@
22 sanitize_fds();
24 /* do some other misc startup stuff while we are here to save bytes */
25 - if (pidfile_acquire(pidfile) < 0)
26 + if (pidfile != NULL && pidfile_acquire(pidfile) < 0)
27 exit(1);
29 /* equivelent of doing a fflush after every \n */
30 --- busybox-1.00/networking/udhcp/pidfile.c~udhcppidfile2
31 +++ busybox-1.00/networking/udhcp/pidfile.c
32 @@ -141,7 +141,11 @@
33 int pidfile_acquire(const char *pidfile)
35 int fd, result;
36 - if (!pidfile) return (-1);
38 + if (pidfile == NULL) {
39 + LOG(LOG_ERR, "pidfile_acquire: filename is NULL\n");
40 + return (-1);
41 + }
43 if ((fd = pidfile_open(pidfile)) < 0)
44 return (-1);
45 @@ -170,7 +174,11 @@
46 int pidfile_reassign(const char *pidfile, int pid)
48 int fd, result;
49 - if (!pidfile) return (-1);
51 + if (pidfile == NULL) {
52 + LOG(LOG_ERR, "pidfile_reassign: filename is NULL\n");
53 + return (-1);
54 + }
56 if ((fd = pidfile_open(pidfile)) < 0)
57 return (-1);