From a12379d1b7dab02e52f76828c2fb9c4aceac3ab1 Mon Sep 17 00:00:00 2001 From: murray Date: Wed, 17 Dec 2008 18:00:18 +0000 Subject: 1. Update fetch to consistently return 1 on error, as the man page states, rather than usually returning 1 but in a few instances using a sysexits(3) return value. 2. Remove a few unused variables from libfetch. PR: docs/122470 (1, only) Reviewed by: des > Description of fields to fill in above: 76 columns --| > PR: If a GNATS PR is affected by the change. > Submitted by: If someone else sent in the change. > Reviewed by: If someone else reviewed your modification. > Approved by: If you needed approval for this commit. > Obtained from: If the change is from a third party. > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > Security: Vulnerability reference (one per line) or description. > Empty fields above will be automatically removed. M usr.bin/fetch/fetch.c M lib/libfetch/fetch.c --- usr.bin/fetch/fetch.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'usr.bin/fetch/fetch.c') diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c index eda8048..bc5268c 100644 --- a/usr.bin/fetch/fetch.c +++ b/usr.bin/fetch/fetch.c @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -865,7 +864,7 @@ main(int argc, char *argv[]) break; default: usage(); - exit(EX_USAGE); + exit(1); } argc -= optind; @@ -874,7 +873,7 @@ main(int argc, char *argv[]) if (h_hostname || f_filename || c_dirname) { if (!h_hostname || !f_filename || argc) { usage(); - exit(EX_USAGE); + exit(1); } /* XXX this is a hack. */ if (strcspn(h_hostname, "@:/") != strlen(h_hostname)) @@ -887,7 +886,7 @@ main(int argc, char *argv[]) if (!argc) { usage(); - exit(EX_USAGE); + exit(1); } /* allocate buffer */ @@ -928,10 +927,10 @@ main(int argc, char *argv[]) } else if (stat(o_filename, &sb) == -1) { if (errno == ENOENT) { if (argc > 1) - errx(EX_USAGE, "%s is not a directory", + errx(1, "%s is not a directory", o_filename); } else { - err(EX_IOERR, "%s", o_filename); + err(1, "%s", o_filename); } } else { if (sb.st_mode & S_IFDIR) -- cgit v1.1