auth/asm12dsa: use fd 0 instead of trying to open /dev/stdin (thanks arpunk)
This commit is contained in:
parent
8ac67646a2
commit
40bc0b9de7
1 changed files with 6 additions and 7 deletions
|
@ -18,7 +18,7 @@ main(int argc, char **argv)
|
||||||
uchar *buf;
|
uchar *buf;
|
||||||
int fd;
|
int fd;
|
||||||
long n, tot;
|
long n, tot;
|
||||||
char *tag, *file;
|
char *tag;
|
||||||
DSApriv *key;
|
DSApriv *key;
|
||||||
|
|
||||||
fmtinstall('B', mpfmt);
|
fmtinstall('B', mpfmt);
|
||||||
|
@ -35,13 +35,12 @@ main(int argc, char **argv)
|
||||||
if(argc != 0 && argc != 1)
|
if(argc != 0 && argc != 1)
|
||||||
usage();
|
usage();
|
||||||
|
|
||||||
if(argc == 1)
|
fd = 0;
|
||||||
file = argv[0];
|
if(argc == 1){
|
||||||
else
|
if((fd = open(*argv, OREAD)) < 0)
|
||||||
file = "/dev/stdin";
|
sysfatal("open %s: %r", *argv);
|
||||||
|
}
|
||||||
|
|
||||||
if((fd = open(file, OREAD)) < 0)
|
|
||||||
sysfatal("open %s: %r", file);
|
|
||||||
buf = nil;
|
buf = nil;
|
||||||
tot = 0;
|
tot = 0;
|
||||||
for(;;){
|
for(;;){
|
||||||
|
|
Loading…
Reference in a new issue