Deleted Added
full compact
oinit.c (104744) oinit.c (199251)
1/*-
2 * Copyright (c) 1998 Andrzej Bialecki
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) 1998 Andrzej Bialecki
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: head/release/picobsd/tinyware/oinit/oinit.c 104744 2002-10-10 00:32:55Z alfred $
26 * $FreeBSD: head/release/picobsd/tinyware/oinit/oinit.c 199251 2009-11-13 11:32:14Z ed $
27 */
28
29/*
30 * A primitive version of init(8) with simplistic user interface
31 */
32
33#include <sys/types.h>
34#include <sys/param.h>

--- 76 unchanged lines hidden (view full) ---

111void do_command(int shell, char *cmdline);
112void transition_handler(int);
113
114/* Table of built-in functions */
115struct command bltins[]={
116 {"cd","Change working directory","cd [dir]","cd /etc",cd},
117 {"pwd","Print current directory","pwd","pwd",pwd},
118 {"exit","Exit from shell()","exit","exit",xit},
27 */
28
29/*
30 * A primitive version of init(8) with simplistic user interface
31 */
32
33#include <sys/types.h>
34#include <sys/param.h>

--- 76 unchanged lines hidden (view full) ---

111void do_command(int shell, char *cmdline);
112void transition_handler(int);
113
114/* Table of built-in functions */
115struct command bltins[]={
116 {"cd","Change working directory","cd [dir]","cd /etc",cd},
117 {"pwd","Print current directory","pwd","pwd",pwd},
118 {"exit","Exit from shell()","exit","exit",xit},
119 {"set","Set environment variable","set [VAR=value]","set TERM=cons25",set},
119 {"set","Set environment variable","set [VAR=value]","set TERM=xterm",set},
120 {"unset","Unset environment variable","unset VAR","unset EDITOR",unset},
121 {"echo","Echo arguments on stdout","echo arg1 arg2 ...","echo Hello World!",echo},
122 {"env","Print all environment variables","env","env",env},
123 {".","Source-in a file with commands",". filename",". /etc/rc",sourcer},
124 {"?","Print this help :-)","? [command]","? set",help},
125 {NULL,NULL,NULL,NULL,NULL}
126};
127

--- 439 unchanged lines hidden (view full) ---

567 revoke(ttys[vty].tty);
568 fd=open(ttys[vty].tty,O_RDWR);
569 dup2(fd,0);
570 dup2(fd,1);
571 dup2(fd,2);
572 if(fd>2) close(fd);
573 login_tty(fd);
574 setpgid(0,getpid());
120 {"unset","Unset environment variable","unset VAR","unset EDITOR",unset},
121 {"echo","Echo arguments on stdout","echo arg1 arg2 ...","echo Hello World!",echo},
122 {"env","Print all environment variables","env","env",env},
123 {".","Source-in a file with commands",". filename",". /etc/rc",sourcer},
124 {"?","Print this help :-)","? [command]","? set",help},
125 {NULL,NULL,NULL,NULL,NULL}
126};
127

--- 439 unchanged lines hidden (view full) ---

567 revoke(ttys[vty].tty);
568 fd=open(ttys[vty].tty,O_RDWR);
569 dup2(fd,0);
570 dup2(fd,1);
571 dup2(fd,2);
572 if(fd>2) close(fd);
573 login_tty(fd);
574 setpgid(0,getpid());
575 putenv("TERM=cons25");
575 putenv("TERM=xterm");
576 putenv("HOME=/");
577 putenv("PATH=/stand:/bin:/usr/bin:/sbin:.");
578 signal(SIGHUP,SIG_DFL);
579 signal(SIGINT,SIG_DFL);
580 signal(SIGQUIT,SIG_DFL);
581 signal(SIGTERM,SIG_DFL);
582 chdir("/");
583 t=(char *)(rindex(ttys[vty].tty,'/')+1);

--- 364 unchanged lines hidden ---
576 putenv("HOME=/");
577 putenv("PATH=/stand:/bin:/usr/bin:/sbin:.");
578 signal(SIGHUP,SIG_DFL);
579 signal(SIGINT,SIG_DFL);
580 signal(SIGQUIT,SIG_DFL);
581 signal(SIGTERM,SIG_DFL);
582 chdir("/");
583 t=(char *)(rindex(ttys[vty].tty,'/')+1);

--- 364 unchanged lines hidden ---