aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/rc
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-02-13 21:38:32 +0000
committerrsc <devnull@localhost>2005-02-13 21:38:32 +0000
commit134c20c60516eb6b6a4f1148a5a24767d38de3a4 (patch)
tree46e873b25e771adf2ebc068e6c5fc5b8d519a03a /src/cmd/rc
parent0faf0f0baa92349a203a419f8e1db76104e42313 (diff)
downloadplan9port-134c20c60516eb6b6a4f1148a5a24767d38de3a4.tar.gz
plan9port-134c20c60516eb6b6a4f1148a5a24767d38de3a4.tar.bz2
plan9port-134c20c60516eb6b6a4f1148a5a24767d38de3a4.zip
handle /dev/stdin always
Diffstat (limited to 'src/cmd/rc')
-rw-r--r--src/cmd/rc/plan9ish.c4
-rw-r--r--src/cmd/rc/simple.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/cmd/rc/plan9ish.c b/src/cmd/rc/plan9ish.c
index c11bf9bb..387fbbb8 100644
--- a/src/cmd/rc/plan9ish.c
+++ b/src/cmd/rc/plan9ish.c
@@ -459,8 +459,8 @@ int Creat(char *file)
int Dup(int a, int b){
return dup(a, b);
}
-int Dup1(int unused0){
- return -1;
+int Dup1(int a){
+ return dup(a, -1);
}
void Exit(char *stat)
{
diff --git a/src/cmd/rc/simple.c b/src/cmd/rc/simple.c
index 6ac02d59..154678f6 100644
--- a/src/cmd/rc/simple.c
+++ b/src/cmd/rc/simple.c
@@ -316,11 +316,11 @@ void execdot(void){
strcpy(file, path->word);
if(file[0]) strcat(file, "/");
strcat(file, zero);
- if((fd=open(file, 0))>=0) break;
if(strcmp(file, "/dev/stdin")==0){ /* for sun & ucb */
fd=Dup1(0);
if(fd>=0) break;
}
+ if((fd=open(file, 0))>=0) break;
}
if(fd<0){
pfmt(err, "%s: ", zero);