diff options
author | bapt <bapt@FreeBSD.org> | 2012-08-24 21:45:52 +0000 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2012-08-24 21:45:52 +0000 |
commit | 160bf3066380115aba023397982297aa1514199e (patch) | |
tree | c709ff7905d4b989d1604a0b75ae2d958a868f5b /usr.sbin | |
parent | c01de858204239bb94ea7de794eea9686cd88cce (diff) | |
download | FreeBSD-src-160bf3066380115aba023397982297aa1514199e.zip FreeBSD-src-160bf3066380115aba023397982297aa1514199e.tar.gz |
Fix confirmation logic when detecting a tty
Reported by: mjg
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pkg/pkg.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/pkg/pkg.c b/usr.sbin/pkg/pkg.c index 50e71cf..8dc7bcf 100644 --- a/usr.sbin/pkg/pkg.c +++ b/usr.sbin/pkg/pkg.c @@ -427,10 +427,10 @@ main(__unused int argc, char *argv[]) */ if (getenv("ASSUME_ALWAYS_YES") == NULL) { printf("%s", confirmation_message); - if (isatty(fileno(stdin)) && - pkg_query_yes_no() == 0) + if (!isatty(fileno(stdin))) exit(EXIT_FAILURE); - else + + if (pkg_query_yes_no() == 0) exit(EXIT_FAILURE); } if (bootstrap_pkg() != 0) |