aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2009-03-17 15:14:26 -0400
committerHarald Hoyer <harald@redhat.com>2009-05-04 16:05:04 +0200
commit8db45a87941794fc24bdbf063be71d1eb1b9522b (patch)
treef0f6bc30f4e220879b04e88023fb4fec7cb72c7a /src
parent8e73f0feee8fc7cc4a502989e737b5ff752bd33d (diff)
downloadinitscripts-8db45a87941794fc24bdbf063be71d1eb1b9522b.tar
initscripts-8db45a87941794fc24bdbf063be71d1eb1b9522b.tar.gz
initscripts-8db45a87941794fc24bdbf063be71d1eb1b9522b.tar.bz2
initscripts-8db45a87941794fc24bdbf063be71d1eb1b9522b.tar.xz
initscripts-8db45a87941794fc24bdbf063be71d1eb1b9522b.zip
Add an option for consoletype to always return 0. (#453798, <notting@redhat.com>)
This allows tcsh -e to work, with lang.sh. It's a hack, but there really isn't a better way to solve it.
Diffstat (limited to 'src')
-rw-r--r--src/consoletype.19
-rw-r--r--src/consoletype.c2
2 files changed, 8 insertions, 3 deletions
diff --git a/src/consoletype.1 b/src/consoletype.1
index 3f4ec14b..ebd1d88c 100644
--- a/src/consoletype.1
+++ b/src/consoletype.1
@@ -3,7 +3,7 @@
\fBconsoletype
\- print type of the console connected to standard input
.SH SYNOPSIS
-\fBconsoletype [\fIfg\fR]
+\fBconsoletype [\fIstdout\fR] [\fIfg\fR]
.SH DESCRIPTION
\fBconsoletype
prints the type of console connected to standard input, and checks
@@ -29,6 +29,11 @@ if on serial console
\fI2
if on a pseudo terminal.
.TP
+When passed the \fIstdout\fR argument, \fBconsoletype\fR returns
+.TP
+\fI0
+in all cases, and prints the console type to stdout.
+.TP
When passed the \fIfg\fR argument, \fBconsoletype\fR returns
.TP
\fI0
@@ -36,4 +41,4 @@ if the console connected to standard input is the current virtual
terminal
.TP
\fI1
-otherwise. \ No newline at end of file
+otherwise.
diff --git a/src/consoletype.c b/src/consoletype.c
index ab7e7534..761a3c52 100644
--- a/src/consoletype.c
+++ b/src/consoletype.c
@@ -61,6 +61,6 @@ int main(int argc, char **argv)
return 0;
} else {
printf("%s\n",type);
- return ret;
+ return (argc > 1 && !strcmp(argv[1],"stdout")) ? 0 : ret;
}
}