summaryrefslogtreecommitdiffstats
path: root/usr.bin/fetch
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1996-08-22 23:25:24 +0000
committerjkh <jkh@FreeBSD.org>1996-08-22 23:25:24 +0000
commite9dba4b462df04cf03473f2e6881efb52dd69c32 (patch)
tree69c6a2f165f9a122d67d16c8b30409885a5f37a1 /usr.bin/fetch
parentccc340f5aa69616bbbd416cc749090a688c283f6 (diff)
downloadFreeBSD-src-e9dba4b462df04cf03473f2e6881efb52dd69c32.zip
FreeBSD-src-e9dba4b462df04cf03473f2e6881efb52dd69c32.tar.gz
Print the correct thing when interrupted by a signal.
Diffstat (limited to 'usr.bin/fetch')
-rw-r--r--usr.bin/fetch/main.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/usr.bin/fetch/main.c b/usr.bin/fetch/main.c
index 5e5f998..868a410 100644
--- a/usr.bin/fetch/main.c
+++ b/usr.bin/fetch/main.c
@@ -24,7 +24,7 @@
* SUCH DAMAGE.
*/
-/* $Id: main.c,v 1.16 1996/08/21 01:27:25 jkh Exp $ */
+/* $Id: main.c,v 1.17 1996/08/22 21:30:51 jkh Exp $ */
#include <stdlib.h>
#include <stdio.h>
@@ -94,10 +94,10 @@ die(int sig)
int e = errno;
rm();
- if (errno)
+ if (!sig)
fprintf (stderr, "%s: %s\n", progname, sys_errlist[e]);
else
- fprintf (stderr, "%s: Interrupted by signal\n", progname);
+ fprintf (stderr, "%s: Interrupted by signal %d\n", progname, sig);
exit(1);
}
@@ -537,11 +537,10 @@ ftperr (FILE* ftp, char *fmt, ...)
if (fmt)
vfprintf(stderr, fmt, ap);
if(ftp) {
- switch (ftpErrno(ftp)) {
- case 421: fprintf (stderr, "Service not available\n"); break;
- case 450: fprintf (stderr, "File not available\n"); break;
- case 550: fprintf (stderr, "No such file or directory\n"); break;
- }
+ const char *str = ftpErrString(ftpErrno(ftp));
+
+ if (str)
+ fprintf(stderr, "%s\n", str);
}
rm ();
exit (1);
OpenPOWER on IntegriCloud