diff options
Diffstat (limited to 'userspace/init.c')
| -rw-r--r-- | userspace/init.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/userspace/init.c b/userspace/init.c index 8530368..0a3b870 100644 --- a/userspace/init.c +++ b/userspace/init.c @@ -3,21 +3,19 @@ int main(int argc, char **argv) { - char *argv1[]={"/bin/foolshell",0}; + char *argv1[]={"/bin/fsh",0}; char *env1[]={"HOME=/home/miguel","PS1=\033[34m$\033[37m","PWD=/home/miguel","PATH=/bin","TERM=fool-term",0}; - time_t ltime; - time(<ime); - printf("fool-init: current time: %s\n", ctime(<ime)); - // loop forever and spawn shells if the top-shell exits while(1) { int pid=_fork(); + if(pid==0) { - _execve("/bin/foolshell",argv1,env1); // replace process with our foolshell :) + printf("fool-init: spawning fool-shell\n"); + _execve("/bin/fsh",argv1,env1); // replace process with our foolshell :) while(1) puts("FATAL ERROR: Something terrible happened. Unable to Execute SHELL!\n"); } @@ -25,9 +23,9 @@ int main(int argc, char **argv) // and respawn SHELL _wait(pid); - printf("fool-init: catched exit of process %d.\n",pid); - printf("fool-init: respawning a new fool-shell\n"); - } + printf("fool-init: respawning new fool-shell\n"); + + } return 0; } |
