aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-05-19 13:12:21 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-05-19 13:12:21 +0000
commit0a8812bdc588fd6e32f7c5ad97cfc9288b9822dc (patch)
treebde7df4ca9bbe31696e23b719c817acbe0e08868
parent14aa06f29c22797bf8bf054afc25a6ef71718734 (diff)
downloadbusybox-w32-0a8812bdc588fd6e32f7c5ad97cfc9288b9822dc.tar.gz
busybox-w32-0a8812bdc588fd6e32f7c5ad97cfc9288b9822dc.tar.bz2
busybox-w32-0a8812bdc588fd6e32f7c5ad97cfc9288b9822dc.zip
- replace _PATH_DEVNULL with bb_dev_null
-rw-r--r--libbb/vfork_daemon_rexec.c17
-rw-r--r--networking/udhcp/common.c10
-rw-r--r--shell/ash.c4
3 files changed, 11 insertions, 20 deletions
diff --git a/libbb/vfork_daemon_rexec.c b/libbb/vfork_daemon_rexec.c
index 80022b390..ffd9dc15e 100644
--- a/libbb/vfork_daemon_rexec.c
+++ b/libbb/vfork_daemon_rexec.c
@@ -1,3 +1,4 @@
1/* vi: set sw=4 ts=4: */
1/* 2/*
2 * Rexec program for system have fork() as vfork() with foreground option 3 * Rexec program for system have fork() as vfork() with foreground option
3 * 4 *
@@ -11,19 +12,7 @@
11 * 12 *
12 * Modified for uClibc by Erik Andersen <andersee@debian.org> 13 * Modified for uClibc by Erik Andersen <andersee@debian.org>
13 * 14 *
14 * This program is free software; you can redistribute it and/or modify 15 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 */ 16 */
28 17
29#include <unistd.h> 18#include <unistd.h>
@@ -46,7 +35,7 @@ void vfork_daemon_rexec(int nochdir, int noclose,
46 if (!nochdir) 35 if (!nochdir)
47 chdir("/"); 36 chdir("/");
48 37
49 if (!noclose && (fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) { 38 if (!noclose && (fd = open(bb_dev_null, O_RDWR, 0)) != -1) {
50 dup2(fd, STDIN_FILENO); 39 dup2(fd, STDIN_FILENO);
51 dup2(fd, STDOUT_FILENO); 40 dup2(fd, STDOUT_FILENO);
52 dup2(fd, STDERR_FILENO); 41 dup2(fd, STDERR_FILENO);
diff --git a/networking/udhcp/common.c b/networking/udhcp/common.c
index f36009a1c..589214bce 100644
--- a/networking/udhcp/common.c
+++ b/networking/udhcp/common.c
@@ -42,8 +42,10 @@ long uptime(void)
42static inline void sanitize_fds(void) 42static inline void sanitize_fds(void)
43{ 43{
44 int zero; 44 int zero;
45 if ((zero = open(_PATH_DEVNULL, O_RDWR, 0)) < 0) return; 45 if ((zero = open(bb_dev_null, O_RDWR, 0)) < 0)
46 while (zero < 3) zero = dup(zero); 46 return;
47 while (zero < 3)
48 zero = dup(zero);
47 close(zero); 49 close(zero);
48} 50}
49 51
@@ -76,7 +78,7 @@ void udhcp_logging(int level, const char *fmt, ...)
76 78
77 va_start(p, fmt); 79 va_start(p, fmt);
78 __va_copy(p2, p); 80 __va_copy(p2, p);
79 if(!daemonized) { 81 if (!daemonized) {
80 vprintf(fmt, p); 82 vprintf(fmt, p);
81 putchar('\n'); 83 putchar('\n');
82 } 84 }
@@ -103,7 +105,7 @@ void udhcp_logging(int level, const char *fmt, ...)
103 va_list p; 105 va_list p;
104 106
105 va_start(p, fmt); 107 va_start(p, fmt);
106 if(!daemonized) { 108 if (!daemonized) {
107 printf("%s, ", syslog_level_msg[level]); 109 printf("%s, ", syslog_level_msg[level]);
108 vprintf(fmt, p); 110 vprintf(fmt, p);
109 putchar('\n'); 111 putchar('\n');
diff --git a/shell/ash.c b/shell/ash.c
index 708ab21fb..33eaf9227 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -7147,8 +7147,8 @@ forkchild(struct job *jp, union node *n, int mode)
7147 ignoresig(SIGQUIT); 7147 ignoresig(SIGQUIT);
7148 if (jp->nprocs == 0) { 7148 if (jp->nprocs == 0) {
7149 close(0); 7149 close(0);
7150 if (open(_PATH_DEVNULL, O_RDONLY) != 0) 7150 if (open(bb_dev_null, O_RDONLY) != 0)
7151 sh_error("Can't open %s", _PATH_DEVNULL); 7151 sh_error("Can't open %s", bb_dev_null);
7152 } 7152 }
7153 } 7153 }
7154 if (!oldlvl && iflag) { 7154 if (!oldlvl && iflag) {