summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libfetch/fetch.c8
-rw-r--r--usr.bin/fetch/fetch.c11
2 files changed, 5 insertions, 14 deletions
diff --git a/lib/libfetch/fetch.c b/lib/libfetch/fetch.c
index 6c4901f..5044fe3 100644
--- a/lib/libfetch/fetch.c
+++ b/lib/libfetch/fetch.c
@@ -74,9 +74,7 @@ static struct fetcherr url_errlist[] = {
FILE *
fetchXGet(struct url *URL, struct url_stat *us, const char *flags)
{
- int direct;
- direct = CHECK_FLAG('d');
if (us != NULL) {
us->size = -1;
us->atime = us->mtime = 0;
@@ -110,9 +108,7 @@ fetchGet(struct url *URL, const char *flags)
FILE *
fetchPut(struct url *URL, const char *flags)
{
- int direct;
- direct = CHECK_FLAG('d');
if (strcasecmp(URL->scheme, SCHEME_FILE) == 0)
return (fetchPutFile(URL, flags));
else if (strcasecmp(URL->scheme, SCHEME_FTP) == 0)
@@ -132,9 +128,7 @@ fetchPut(struct url *URL, const char *flags)
int
fetchStat(struct url *URL, struct url_stat *us, const char *flags)
{
- int direct;
- direct = CHECK_FLAG('d');
if (us != NULL) {
us->size = -1;
us->atime = us->mtime = 0;
@@ -158,9 +152,7 @@ fetchStat(struct url *URL, struct url_stat *us, const char *flags)
struct url_ent *
fetchList(struct url *URL, const char *flags)
{
- int direct;
- direct = CHECK_FLAG('d');
if (strcasecmp(URL->scheme, SCHEME_FILE) == 0)
return (fetchListFile(URL, flags));
else if (strcasecmp(URL->scheme, SCHEME_FTP) == 0)
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 <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sysexits.h>
#include <termios.h>
#include <unistd.h>
@@ -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)
OpenPOWER on IntegriCloud