]> Pileus Git - ~andy/fetchmail/blobdiff - getpass.c
Describe 550 better.
[~andy/fetchmail] / getpass.c
index 88c4a04c5958b1f5d0c92621808c649b7e5852e4..6e4b93cf21889576926ad8f69f30c5bee374fb41 100644 (file)
--- a/getpass.c
+++ b/getpass.c
@@ -17,6 +17,7 @@
 #include <stdio.h>
 #include <signal.h>
 #include <fcntl.h>
+#include <stdlib.h>
 #if defined(HAVE_UNISTD_H)
 #include <unistd.h>
 #endif
@@ -60,7 +61,7 @@ void static disable_tty_echo(void);
 void static restore_tty_state(void);
 static RETSIGTYPE sigint_handler(int);
 
-char *getpassword(prompt)
+char *fm_getpassword(prompt)
 char *prompt;
 {
 #if !(defined(HAVE_TCSETATTR) || defined(HAVE_TERMIO_H) || defined(HAVE_STTY))
@@ -68,7 +69,7 @@ char *prompt;
     char *getpass();
     return getpass(prompt);
 #else
-    fputs(_("ERROR: no support for getpassword() routine\n"),stderr);
+    fputs(GT_("ERROR: no support for getpassword() routine\n"),stderr);
     exit(1);
 #endif
 #else
@@ -131,7 +132,7 @@ char *prompt;
        signal(SIGINT, sig);
     }
     if (fi != stdin)
-       fclose(fi);
+       fclose(fi);     /* not checking should be safe, file mode was "r" */
 
     return(pbuf);
 #endif /* !(defined(HAVE_TCSETATTR) || ... */
@@ -190,7 +191,8 @@ static void restore_tty_state(void)
 static RETSIGTYPE sigint_handler(int signum)
 {
     restore_tty_state();
-    report(stderr, 1, 0, _("\nCaught signal... bailing out.\n"));
+    report(stderr, GT_("\nCaught SIGINT... bailing out.\n"));
+    exit(1);
 }
 
 /* getpass.c ends here */