* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2012, 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
# endif
#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
+#define _MPRINTF_REPLACE
+#include <curl/mprintf.h>
+
#include "tool_getpass.h"
#include "memdebug.h" /* keep this as LAST include */
bool disabled;
int fd = open("/dev/tty", O_RDONLY);
if(-1 == fd)
- fd = STDIN_FILENO; /* use stdin if the tty couldn't be used */
+ fd = 1; /* use stdin if the tty couldn't be used */
disabled = ttyecho(FALSE, fd); /* disable terminal echo */
(void)ttyecho(TRUE, fd); /* enable echo */
}
- if(STDIN_FILENO != fd)
+ if(1 != fd)
close(fd);
return password; /* return pointer to buffer */