summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2013-06-19 22:07:10 +0200
committercinap_lenrek <cinap_lenrek@gmx.de>2013-06-19 22:07:10 +0200
commit40bc0b9de717c9f7cfadcca1d6d21bb115b3e8bb (patch)
treefac39f5f11d3e96a441d83d121935a5ed130dd7f
parent8ac67646a2025f1ae431f8827a8a586497c993dd (diff)
downloadplan9front-40bc0b9de717c9f7cfadcca1d6d21bb115b3e8bb.tar.xz
auth/asm12dsa: use fd 0 instead of trying to open /dev/stdin (thanks arpunk)
-rw-r--r--sys/src/cmd/auth/asn12dsa.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/src/cmd/auth/asn12dsa.c b/sys/src/cmd/auth/asn12dsa.c
index 7df5dd781..b7e770ed4 100644
--- a/sys/src/cmd/auth/asn12dsa.c
+++ b/sys/src/cmd/auth/asn12dsa.c
@@ -18,7 +18,7 @@ main(int argc, char **argv)
uchar *buf;
int fd;
long n, tot;
- char *tag, *file;
+ char *tag;
DSApriv *key;
fmtinstall('B', mpfmt);
@@ -35,13 +35,12 @@ main(int argc, char **argv)
if(argc != 0 && argc != 1)
usage();
- if(argc == 1)
- file = argv[0];
- else
- file = "/dev/stdin";
+ fd = 0;
+ if(argc == 1){
+ if((fd = open(*argv, OREAD)) < 0)
+ sysfatal("open %s: %r", *argv);
+ }
- if((fd = open(file, OREAD)) < 0)
- sysfatal("open %s: %r", file);
buf = nil;
tot = 0;
for(;;){