aboutsummaryrefslogtreecommitdiff
path: root/console-tools
diff options
context:
space:
mode:
authorvda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-03-26 13:35:09 +0000
committervda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-03-26 13:35:09 +0000
commite23052af8fb88e90e88f59671af5264d12eb7686 (patch)
treef4ae0be26d5debff091d2c976e77fa8050c6758c /console-tools
parent7588a049ebf057514cc194eb8835cfd85e954af8 (diff)
downloadbusybox-w32-e23052af8fb88e90e88f59671af5264d12eb7686.tar.gz
busybox-w32-e23052af8fb88e90e88f59671af5264d12eb7686.tar.bz2
busybox-w32-e23052af8fb88e90e88f59671af5264d12eb7686.zip
Attempt to get more applets compile for NOMMU.
TODO_config_nommu documents what I managed to compile so far (yay! msh works! cool). inetd, telnetd, httpd still do not compile. TODO Also make fork(), daemon() produce warnings on compile stage (in addition to erros on link stage). git-svn-id: svn://busybox.net/trunk/busybox@18245 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'console-tools')
-rw-r--r--console-tools/openvt.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/console-tools/openvt.c b/console-tools/openvt.c
index 0584584df..882563b29 100644
--- a/console-tools/openvt.c
+++ b/console-tools/openvt.c
@@ -15,30 +15,21 @@
15int openvt_main(int argc, char **argv); 15int openvt_main(int argc, char **argv);
16int openvt_main(int argc, char **argv) 16int openvt_main(int argc, char **argv)
17{ 17{
18 int fd;
19 char vtname[sizeof(VC_FORMAT) + 2]; 18 char vtname[sizeof(VC_FORMAT) + 2];
20 19
21 if (argc < 3) { 20 if (argc < 3)
22 bb_show_usage(); 21 bb_show_usage();
23 } 22
24 /* check for illegal vt number: < 1 or > 63 */ 23 /* check for illegal vt number: < 1 or > 63 */
25 sprintf(vtname, VC_FORMAT, (int)xatou_range(argv[1], 1, 63)); 24 sprintf(vtname, VC_FORMAT, (int)xatou_range(argv[1], 1, 63));
26 25
27//FIXME NOMMU 26 bb_daemonize_or_rexec(DAEMON_CLOSE_EXTRA_FDS, argv);
28 if (fork() == 0) { 27 /* grab new one */
29 /* child */ 28 close(0);
30 /* leave current vt (controlling tty) */ 29 xopen(vtname, O_RDWR);
31 setsid(); 30 dup2(0, STDOUT_FILENO);
32 /* and grab new one */ 31 dup2(0, STDERR_FILENO);
33 fd = xopen(vtname, O_RDWR);
34 /* Reassign stdin, stdout and sterr */
35 dup2(fd, STDIN_FILENO);
36 dup2(fd, STDOUT_FILENO);
37 dup2(fd, STDERR_FILENO);
38 while (fd > 2) close(fd--);
39 32
40 BB_EXECVP(argv[2], &argv[2]); 33 BB_EXECVP(argv[2], &argv[2]);
41 _exit(1); 34 _exit(1);
42 }
43 return EXIT_SUCCESS;
44} 35}