aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/ar/ar.c
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2021-08-12 19:37:25 +0000
committerEd Maste <emaste@FreeBSD.org>2021-08-13 14:39:44 +0000
commit086f09087713e3af0a28d296a2372071b72211ef (patch)
tree37473685308b7e28a150dd4fbde8fd14683377af /usr.bin/ar/ar.c
parent3d69515cfea2781b318ebe1c6e6018d817cde358 (diff)
Diffstat (limited to 'usr.bin/ar/ar.c')
-rw-r--r--usr.bin/ar/ar.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/usr.bin/ar/ar.c b/usr.bin/ar/ar.c
index b131163342a6..aceb4d7f8487 100644
--- a/usr.bin/ar/ar.c
+++ b/usr.bin/ar/ar.c
@@ -162,8 +162,7 @@ main(int argc, char **argv)
if (*argv[1] != '-') {
len = strlen(argv[1]) + 2;
if ((p = malloc(len)) == NULL)
- bsdar_errc(bsdar, EXIT_FAILURE, errno,
- "malloc failed");
+ bsdar_errc(bsdar, errno, "malloc failed");
*p = '-';
(void)strlcpy(p + 1, argv[1], len - 1);
argv[1] = p;
@@ -263,24 +262,20 @@ main(int argc, char **argv)
bsdar_usage();
if (bsdar->options & AR_A && bsdar->options & AR_B)
- bsdar_errc(bsdar, EXIT_FAILURE, 0,
+ bsdar_errc(bsdar, 0,
"only one of -a and -[bi] options allowed");
if (bsdar->options & AR_J && bsdar->options & AR_Z)
- bsdar_errc(bsdar, EXIT_FAILURE, 0,
- "only one of -j and -z options allowed");
+ bsdar_errc(bsdar, 0, "only one of -j and -z options allowed");
if (bsdar->options & AR_S && bsdar->options & AR_SS)
- bsdar_errc(bsdar, EXIT_FAILURE, 0,
- "only one of -s and -S options allowed");
+ bsdar_errc(bsdar, 0, "only one of -s and -S options allowed");
if (bsdar->options & (AR_A | AR_B)) {
if (*argv == NULL)
- bsdar_errc(bsdar, EXIT_FAILURE, 0,
- "no position operand specified");
+ bsdar_errc(bsdar, 0, "no position operand specified");
if ((bsdar->posarg = basename(*argv)) == NULL)
- bsdar_errc(bsdar, EXIT_FAILURE, errno,
- "basename failed");
+ bsdar_errc(bsdar, errno, "basename failed");
argc--;
argv++;
}
@@ -370,8 +365,8 @@ set_mode(struct bsdar *bsdar, char opt)
{
if (bsdar->mode != '\0' && bsdar->mode != opt)
- bsdar_errc(bsdar, EXIT_FAILURE, 0,
- "Can't specify both -%c and -%c", opt, bsdar->mode);
+ bsdar_errc(bsdar, 0, "Can't specify both -%c and -%c", opt,
+ bsdar->mode);
bsdar->mode = opt;
}
@@ -380,8 +375,8 @@ only_mode(struct bsdar *bsdar, const char *opt, const char *valid_modes)
{
if (strchr(valid_modes, bsdar->mode) == NULL)
- bsdar_errc(bsdar, EXIT_FAILURE, 0,
- "Option %s is not permitted in mode -%c", opt, bsdar->mode);
+ bsdar_errc(bsdar, 0, "Option %s is not permitted in mode -%c",
+ opt, bsdar->mode);
}
static void