summaryrefslogtreecommitdiff
path: root/libarchive_fe
diff options
context:
space:
mode:
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>2014-09-21 18:36:45 +0900
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>2014-09-21 18:36:45 +0900
commitd057b953d9b7560a5bcee159d89ff14bd82120db (patch)
tree12ae18f04a59a31888d22450e4a4b2cef9a17d9e /libarchive_fe
parent9769e6f7d5683d79511b40c84fb1c60291e1b72d (diff)
downloadlibarchive-d057b953d9b7560a5bcee159d89ff14bd82120db.tar.gz
Fix build failure on Ubuntu.
Diffstat (limited to 'libarchive_fe')
-rw-r--r--libarchive_fe/passphrase.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/libarchive_fe/passphrase.c b/libarchive_fe/passphrase.c
index 5e18b7f7..90d6f1b2 100644
--- a/libarchive_fe/passphrase.c
+++ b/libarchive_fe/passphrase.c
@@ -91,6 +91,9 @@ readpassphrase(const char *prompt, char *buf, size_t bufsiz, int flags)
#include <signal.h>
#include <ctype.h>
#include <fcntl.h>
+#ifdef HAVE_PATHS_H
+#include <paths.h>
+#endif
#include <string.h>
#include <unistd.h>
@@ -187,8 +190,10 @@ restart:
/* No I/O if we are already backgrounded. */
if (signo[SIGTTOU] != 1 && signo[SIGTTIN] != 1) {
- if (!(flags & RPP_STDIN))
- (void)write(output, prompt, strlen(prompt));
+ if (!(flags & RPP_STDIN)) {
+ int r = write(output, prompt, strlen(prompt));
+ (void)r;
+ }
end = buf + bufsiz - 1;
p = buf;
while ((nr = read(input, &ch, 1)) == 1 && ch != '\n' && ch != '\r') {
@@ -206,8 +211,10 @@ restart:
}
*p = '\0';
save_errno = errno;
- if (!(term.c_lflag & ECHO))
- (void)write(output, "\n", 1);
+ if (!(term.c_lflag & ECHO)) {
+ int r = write(output, "\n", 1);
+ (void)r;
+ }
}
/* Restore old terminal settings and signals. */