commit 134c20c60516eb6b6a4f1148a5a24767d38de3a4
parent 0faf0f0baa92349a203a419f8e1db76104e42313
Author: rsc <devnull@localhost>
Date: Sun, 13 Feb 2005 21:38:32 +0000
handle /dev/stdin always
Diffstat:
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git 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
@@ -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);