[Xxvt-commit] CVS: xxvt init.c,1.25,1.26
Status: Pre-Alpha
Brought to you by:
nlevitt
|
From: Pierre-Paul L. <pp...@us...> - 2002-03-31 03:40:57
|
Update of /cvsroot/xxvt/xxvt
In directory usw-pr-cvs1:/tmp/cvs-serv18709
Modified Files:
init.c
Log Message:
looking for $SHELL, if not available we use /bin/sh as default shell.
when exec in children, if it fails, perror then sleep 5 seconds so the user
can see what's happening. xterm does the same.
Index: init.c
===================================================================
RCS file: /cvsroot/xxvt/xxvt/init.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** init.c 30 Mar 2002 17:18:00 -0000 1.25
--- init.c 31 Mar 2002 03:40:53 -0000 1.26
***************
*** 58,61 ****
--- 58,65 ----
cmd_t *cmd;
char *ttyname;
+ char *shell;
+
+ if ( (shell = getenv("SHELL")) == NULL)
+ shell = "/bin/sh";
cmd = xxvt_malloc(sizeof(cmd_t));
***************
*** 79,84 ****
close(cmd->tty);
! execl("/bin/bash", "/bin/bash", NULL);
perror("execl");
exit(EXIT_FAILURE);
/* NOTREACHED */
--- 83,89 ----
close(cmd->tty);
! execl(shell, shell, NULL);
perror("execl");
+ sleep(5);
exit(EXIT_FAILURE);
/* NOTREACHED */
|