util.c (be72428e547a9014d0f7a220ebc9bd8395835a7f) util.c (d20e9e02db3dde383c3de1ce8cec3a8c35b3eee6)
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 2003-2007 Tim Kientzle
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 63 unchanged lines hidden (view full) ---

72 fprintf(stderr, "%s: fatal: ", bsdar->progname);
73 vfprintf(stderr, fmt, ap);
74 if (code != 0)
75 fprintf(stderr, ": %s", strerror(code));
76 fprintf(stderr, "\n");
77}
78
79void
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 2003-2007 Tim Kientzle
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 63 unchanged lines hidden (view full) ---

72 fprintf(stderr, "%s: fatal: ", bsdar->progname);
73 vfprintf(stderr, fmt, ap);
74 if (code != 0)
75 fprintf(stderr, ": %s", strerror(code));
76 fprintf(stderr, "\n");
77}
78
79void
80bsdar_errc(struct bsdar *bsdar, int eval, int code, const char *fmt, ...)
80bsdar_errc(struct bsdar *bsdar, int code, const char *fmt, ...)
81{
82 va_list ap;
83
84 va_start(ap, fmt);
85 bsdar_verrc(bsdar, code, fmt, ap);
86 va_end(ap);
81{
82 va_list ap;
83
84 va_start(ap, fmt);
85 bsdar_verrc(bsdar, code, fmt, ap);
86 va_end(ap);
87 exit(eval);
87 exit(EXIT_FAILURE);
88}
88}