aboutsummaryrefslogtreecommitdiff
path: root/release/picobsd/tinyware/oinit/oinit.c
diff options
context:
space:
mode:
authorAlexander Langer <alex@FreeBSD.org>2001-01-20 09:12:55 +0000
committerAlexander Langer <alex@FreeBSD.org>2001-01-20 09:12:55 +0000
commit5a86d4eafc1c9d171f285eefb107eecd7a5ef03f (patch)
treec37f789e689a7a9e2ca04be6b4e4bf70b8482834 /release/picobsd/tinyware/oinit/oinit.c
parent7dd2de5bc24aeb5eb9273cb8d45bc78c25efa2d6 (diff)
downloadsrc-5a86d4eafc1c9d171f285eefb107eecd7a5ef03f.tar.gz
src-5a86d4eafc1c9d171f285eefb107eecd7a5ef03f.zip
Make the name of the init script and the interpreter compile time options.
If not defined, default to the old values (with _PATH_BSHELL instead of "/bin/sh", though). Reviewed by: markm
Notes
Notes: svn path=/head/; revision=71295
Diffstat (limited to 'release/picobsd/tinyware/oinit/oinit.c')
-rw-r--r--release/picobsd/tinyware/oinit/oinit.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/release/picobsd/tinyware/oinit/oinit.c b/release/picobsd/tinyware/oinit/oinit.c
index 66b5623cef92..87b244835907 100644
--- a/release/picobsd/tinyware/oinit/oinit.c
+++ b/release/picobsd/tinyware/oinit/oinit.c
@@ -599,6 +599,15 @@ start_session(int vty, int argc, char **argv)
* normal /etc/rc interpreted by Bourne shell.
*/
#ifndef OINIT_RC
+#ifndef SH_NAME
+#define SH_NAME "-sh"
+#endif
+#ifndef SH_PATH
+#define SH_PATH _PATH_BSHELL
+#endif
+#ifndef SH_ARG
+#define SH_ARG "/etc/rc"
+#endif
void
runcom()
{
@@ -617,10 +626,10 @@ runcom()
dup2(fd,1);
dup2(fd,2);
if(fd>2) close(fd);
- argv[0]="-sh";
- argv[1]="/etc/rc";
+ argv[0]=SH_NAME;
+ argv[1]=SH_ARG;
argv[2]=0;
- execvp("/bin/sh",argv);
+ execvp(SH_PATH,argv);
printf("runcom(): %s\n",strerror(errno));
_exit(1);
}