aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author"Vladimir N. Oleynik" <dzo@simtreas.ru>2005-10-12 15:34:25 +0000
committer"Vladimir N. Oleynik" <dzo@simtreas.ru>2005-10-12 15:34:25 +0000
commit6c35c7c97628cb81eb26c2a059b0dde2879d91aa (patch)
tree0da08a6d852fcb5d68bbe3a368460ed815b74923
parent86a1073e0bfa608defbfaa43d94a537c5e700efe (diff)
downloadbusybox-w32-6c35c7c97628cb81eb26c2a059b0dde2879d91aa.tar.gz
busybox-w32-6c35c7c97628cb81eb26c2a059b0dde2879d91aa.tar.bz2
busybox-w32-6c35c7c97628cb81eb26c2a059b0dde2879d91aa.zip
usage bb_dev_null
-rw-r--r--archival/gunzip.c2
-rw-r--r--coreutils/nohup.c2
-rw-r--r--e2fsprogs/blkid/cache.c2
-rw-r--r--e2fsprogs/blkid/devname.c2
-rw-r--r--e2fsprogs/blkid/probe.c2
-rw-r--r--e2fsprogs/blkid/resolve.c2
-rw-r--r--e2fsprogs/blkid/save.c2
-rw-r--r--e2fsprogs/e2fsck.c2
-rw-r--r--init/init.c4
-rw-r--r--libbb/messages.c4
-rw-r--r--networking/traceroute.c3
-rw-r--r--shell/msh.c2
12 files changed, 14 insertions, 15 deletions
diff --git a/archival/gunzip.c b/archival/gunzip.c
index a4db7ca31..76738b017 100644
--- a/archival/gunzip.c
+++ b/archival/gunzip.c
@@ -116,7 +116,7 @@ extern int gunzip_main(int argc, char **argv)
116 116
117 /* Set output filename and number */ 117 /* Set output filename and number */
118 if (opt & GUNZIP_OPT_TEST) { 118 if (opt & GUNZIP_OPT_TEST) {
119 dst_fd = bb_xopen("/dev/null", O_WRONLY); /* why does test use filenum 2 ? */ 119 dst_fd = bb_xopen(bb_dev_null, O_WRONLY); /* why does test use filenum 2 ? */
120 } else if (opt & GUNZIP_OPT_STDOUT) { 120 } else if (opt & GUNZIP_OPT_STDOUT) {
121 dst_fd = STDOUT_FILENO; 121 dst_fd = STDOUT_FILENO;
122 } else { 122 } else {
diff --git a/coreutils/nohup.c b/coreutils/nohup.c
index c457bfd93..febaf547f 100644
--- a/coreutils/nohup.c
+++ b/coreutils/nohup.c
@@ -115,7 +115,7 @@ int nohup_main (int argc, char **argv)
115 Note that it is deliberately opened for *writing*, 115 Note that it is deliberately opened for *writing*,
116 to ensure any read evokes an error. */ 116 to ensure any read evokes an error. */
117 if (isatty (STDIN_FILENO)) 117 if (isatty (STDIN_FILENO))
118 fd_reopen (STDIN_FILENO, "/dev/null", 0); 118 fd_reopen (STDIN_FILENO, bb_dev_null, 0);
119 119
120 /* If standard output is a tty, redirect it (appending) to a file. 120 /* If standard output is a tty, redirect it (appending) to a file.
121 First try nohup.out, then $HOME/nohup.out. */ 121 First try nohup.out, then $HOME/nohup.out. */
diff --git a/e2fsprogs/blkid/cache.c b/e2fsprogs/blkid/cache.c
index 88cc326cc..0dd1b6286 100644
--- a/e2fsprogs/blkid/cache.c
+++ b/e2fsprogs/blkid/cache.c
@@ -111,7 +111,7 @@ int main(int argc, char** argv)
111 argv[1] ? argv[1] : BLKID_CACHE_FILE); 111 argv[1] ? argv[1] : BLKID_CACHE_FILE);
112 exit(1); 112 exit(1);
113 } 113 }
114 if ((ret = blkid_get_cache(&cache, "/dev/null")) != 0) { 114 if ((ret = blkid_get_cache(&cache, bb_dev_null)) != 0) {
115 fprintf(stderr, "%s: error creating cache (%d)\n", 115 fprintf(stderr, "%s: error creating cache (%d)\n",
116 argv[0], ret); 116 argv[0], ret);
117 exit(1); 117 exit(1);
diff --git a/e2fsprogs/blkid/devname.c b/e2fsprogs/blkid/devname.c
index b3230212d..b5db29e30 100644
--- a/e2fsprogs/blkid/devname.c
+++ b/e2fsprogs/blkid/devname.c
@@ -355,7 +355,7 @@ int main(int argc, char **argv)
355 "Probe all devices and exit\n", argv[0]); 355 "Probe all devices and exit\n", argv[0]);
356 exit(1); 356 exit(1);
357 } 357 }
358 if ((ret = blkid_get_cache(&cache, "/dev/null")) != 0) { 358 if ((ret = blkid_get_cache(&cache, bb_dev_null)) != 0) {
359 fprintf(stderr, "%s: error creating cache (%d)\n", 359 fprintf(stderr, "%s: error creating cache (%d)\n",
360 argv[0], ret); 360 argv[0], ret);
361 exit(1); 361 exit(1);
diff --git a/e2fsprogs/blkid/probe.c b/e2fsprogs/blkid/probe.c
index 9008dc85c..1c30460f6 100644
--- a/e2fsprogs/blkid/probe.c
+++ b/e2fsprogs/blkid/probe.c
@@ -680,7 +680,7 @@ int main(int argc, char **argv)
680 "Probe a single device to determine type\n", argv[0]); 680 "Probe a single device to determine type\n", argv[0]);
681 exit(1); 681 exit(1);
682 } 682 }
683 if ((ret = blkid_get_cache(&cache, "/dev/null")) != 0) { 683 if ((ret = blkid_get_cache(&cache, bb_dev_null)) != 0) {
684 fprintf(stderr, "%s: error creating cache (%d)\n", 684 fprintf(stderr, "%s: error creating cache (%d)\n",
685 argv[0], ret); 685 argv[0], ret);
686 exit(1); 686 exit(1);
diff --git a/e2fsprogs/blkid/resolve.c b/e2fsprogs/blkid/resolve.c
index 3dca74ff4..625782d44 100644
--- a/e2fsprogs/blkid/resolve.c
+++ b/e2fsprogs/blkid/resolve.c
@@ -121,7 +121,7 @@ int main(int argc, char **argv)
121 argv[0], argv[0]); 121 argv[0], argv[0]);
122 exit(1); 122 exit(1);
123 } 123 }
124 if (blkid_get_cache(&cache, "/dev/null") < 0) { 124 if (blkid_get_cache(&cache, bb_dev_null) < 0) {
125 fprintf(stderr, "Couldn't get blkid cache\n"); 125 fprintf(stderr, "Couldn't get blkid cache\n");
126 exit(1); 126 exit(1);
127 } 127 }
diff --git a/e2fsprogs/blkid/save.c b/e2fsprogs/blkid/save.c
index 1830e459a..3fba2450a 100644
--- a/e2fsprogs/blkid/save.c
+++ b/e2fsprogs/blkid/save.c
@@ -166,7 +166,7 @@ int main(int argc, char **argv)
166 exit(1); 166 exit(1);
167 } 167 }
168 168
169 if ((ret = blkid_get_cache(&cache, "/dev/null")) != 0) { 169 if ((ret = blkid_get_cache(&cache, bb_dev_null)) != 0) {
170 fprintf(stderr, "%s: error creating cache (%d)\n", 170 fprintf(stderr, "%s: error creating cache (%d)\n",
171 argv[0], ret); 171 argv[0], ret);
172 exit(1); 172 exit(1);
diff --git a/e2fsprogs/e2fsck.c b/e2fsprogs/e2fsck.c
index fc7e740ac..42ee8abc4 100644
--- a/e2fsprogs/e2fsck.c
+++ b/e2fsprogs/e2fsck.c
@@ -15086,7 +15086,7 @@ static void reserve_stdio_fds(void)
15086 int fd; 15086 int fd;
15087 15087
15088 while (1) { 15088 while (1) {
15089 fd = open("/dev/null", O_RDWR); 15089 fd = open(bb_dev_null, O_RDWR);
15090 if (fd > 2) 15090 if (fd > 2)
15091 break; 15091 break;
15092 if (fd < 0) { 15092 if (fd < 0) {
diff --git a/init/init.c b/init/init.c
index 166f526e0..96c704670 100644
--- a/init/init.c
+++ b/init/init.c
@@ -353,7 +353,7 @@ static void console_init(void)
353#ifndef CONFIG_SYSLOGD 353#ifndef CONFIG_SYSLOGD
354 log_console = 354 log_console =
355#endif 355#endif
356 safe_strncpy(console, "/dev/null", sizeof(console)); 356 safe_strncpy(console, bb_dev_null, sizeof(console));
357 } else { 357 } else {
358 s = getenv("TERM"); 358 s = getenv("TERM");
359 /* check for serial console */ 359 /* check for serial console */
@@ -834,7 +834,7 @@ static void new_init_action(int action, const char *command, const char *cons)
834 /* do not run entries if console device is not available */ 834 /* do not run entries if console device is not available */
835 if (access(cons, R_OK | W_OK)) 835 if (access(cons, R_OK | W_OK))
836 return; 836 return;
837 if (strcmp(cons, "/dev/null") == 0 && (action & ASKFIRST)) 837 if (strcmp(cons, bb_dev_null) == 0 && (action & ASKFIRST))
838 return; 838 return;
839 839
840 new_action = calloc((size_t) (1), sizeof(struct init_action)); 840 new_action = calloc((size_t) (1), sizeof(struct init_action));
diff --git a/libbb/messages.c b/libbb/messages.c
index e6e4dc30d..9a77aa64b 100644
--- a/libbb/messages.c
+++ b/libbb/messages.c
@@ -97,7 +97,7 @@ const char * const bb_path_motd_file = MOTD_FILE;
97const char * const bb_default_login_shell = LIBBB_DEFAULT_LOGIN_SHELL; 97const char * const bb_default_login_shell = LIBBB_DEFAULT_LOGIN_SHELL;
98#endif 98#endif
99 99
100#ifdef L_dev_null 100#ifdef L_bb_dev_null
101const char * const bb_dev_null = "dev/null"; 101const char * const bb_dev_null = "/dev/null";
102#endif 102#endif
103 103
diff --git a/networking/traceroute.c b/networking/traceroute.c
index 15d55e79b..d716f2f73 100644
--- a/networking/traceroute.c
+++ b/networking/traceroute.c
@@ -321,7 +321,6 @@ static int maxpacket = 32 * 1024; /* max ip packet size */
321static int pmtu; /* Path MTU Discovery (RFC1191) */ 321static int pmtu; /* Path MTU Discovery (RFC1191) */
322 322
323static char *hostname; 323static char *hostname;
324static const char devnull[] = "/dev/null";
325 324
326static u_short ident; 325static u_short ident;
327static u_short port = 32768 + 666; /* start udp dest port # for probe packets */ 326static u_short port = 32768 + 666; /* start udp dest port # for probe packets */
@@ -1090,7 +1089,7 @@ traceroute_main(int argc, char *argv[])
1090 bb_perror_msg_and_die("unknown protocol %s", cp); 1089 bb_perror_msg_and_die("unknown protocol %s", cp);
1091 1090
1092 /* Insure the socket fds won't be 0, 1 or 2 */ 1091 /* Insure the socket fds won't be 0, 1 or 2 */
1093 do n = bb_xopen(devnull, O_RDONLY); while (n < 2); 1092 do n = bb_xopen(bb_dev_null, O_RDONLY); while (n < 2);
1094 if (n > 2) 1093 if (n > 2)
1095 close(n); 1094 close(n);
1096 1095
diff --git a/shell/msh.c b/shell/msh.c
index 25c98a430..30ebc7a3a 100644
--- a/shell/msh.c
+++ b/shell/msh.c
@@ -2714,7 +2714,7 @@ int act;
2714 interactive = 0; 2714 interactive = 0;
2715 if (pin == NULL) { 2715 if (pin == NULL) {
2716 close(0); 2716 close(0);
2717 open("/dev/null", 0); 2717 open(bb_dev_null, 0);
2718 } 2718 }
2719 _exit(execute(t->left, pin, pout, FEXEC)); 2719 _exit(execute(t->left, pin, pout, FEXEC));
2720 } 2720 }