summaryrefslogtreecommitdiff
path: root/src/tool_getpass.c
diff options
context:
space:
mode:
authorSeonah Moon <seonah1.moon@samsung.com>2016-04-07 11:41:57 +0900
committerSeonah Moon <seonah1.moon@samsung.com>2016-04-07 13:29:05 +0900
commit8a08705db260779441360e959b97b6c172f8acb0 (patch)
treee5cfc1f4bc28cd81e93a96f9707a0efb143d278a /src/tool_getpass.c
parentf7bbc1c9b6a8e2c815d09612b53f453c90d962e0 (diff)
downloadcurl-8a08705db260779441360e959b97b6c172f8acb0.tar.gz
curl-8a08705db260779441360e959b97b6c172f8acb0.tar.bz2
curl-8a08705db260779441360e959b97b6c172f8acb0.zip
Imported Upstream version 7.44.0
Change-Id: I04e7fac0b620653ff8c174e87039756e98c4fb02
Diffstat (limited to 'src/tool_getpass.c')
-rw-r--r--src/tool_getpass.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/tool_getpass.c b/src/tool_getpass.c
index 4c8dcb9f1..0f7ed01f7 100644
--- a/src/tool_getpass.c
+++ b/src/tool_getpass.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -52,9 +52,9 @@
# endif
#endif
-#define _MPRINTF_REPLACE
-#include <curl/mprintf.h>
-
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
#include "tool_getpass.h"
#include "memdebug.h" /* keep this as LAST include */
@@ -229,7 +229,7 @@ char *getpass_r(const char *prompt, /* prompt to display */
bool disabled;
int fd = open("/dev/tty", O_RDONLY);
if(-1 == fd)
- fd = 1; /* use stdin if the tty couldn't be used */
+ fd = STDIN_FILENO; /* use stdin if the tty couldn't be used */
disabled = ttyecho(FALSE, fd); /* disable terminal echo */
@@ -246,7 +246,7 @@ char *getpass_r(const char *prompt, /* prompt to display */
(void)ttyecho(TRUE, fd); /* enable echo */
}
- if(1 != fd)
+ if(STDIN_FILENO != fd)
close(fd);
return password; /* return pointer to buffer */