Permalink
Browse files

clear errno after it could be set to avoid confusing errors.

  • Loading branch information...
jmesmon authored and bwalex committed Jun 15, 2012
1 parent 86961f5 commit e8bb2bba1a68e474dc948b3a81c942e14946f338
Showing with 3 additions and 0 deletions.
  1. +3 −0 io.c
View
3 io.c
@@ -358,6 +358,9 @@ read_passphrase(const char *prompt, char *pass, size_t passlen, time_t timeout)
struct sigaction act, old_act;
int is_tty = isatty(fd);
+ if (is_tty == 0)
+ errno = 0;
+
memset(pass, 0, passlen);
/* If input is being provided by something which is not a terminal, don't

0 comments on commit e8bb2bb

Please sign in to comment.