mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-10-06 07:03:32 +00:00
The ebpf packages were somewhat neglected during the restructuring of the the repository and currently do not build. They were also a little awkward to use. So move them to ./projects for now until it matures. Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
30 lines
620 B
C
30 lines
620 B
C
# include <stdio.h>
|
|
# include <stdarg.h>
|
|
# include <stdlib.h>
|
|
# include <string.h>
|
|
static void error_at_line(int status, int errnum, const char *filename,
|
|
unsigned int linenum, const char *format, ...)
|
|
{
|
|
va_list ap;
|
|
|
|
fflush(stdout);
|
|
|
|
if (filename != NULL)
|
|
fprintf(stderr, "%s:%u: ", filename, linenum);
|
|
|
|
va_start(ap, format);
|
|
vfprintf(stderr, format, ap);
|
|
va_end(ap);
|
|
|
|
if (errnum != 0)
|
|
fprintf(stderr, ": %s", strerror(errnum));
|
|
|
|
fprintf(stderr, "\n");
|
|
|
|
if (status != 0)
|
|
exit(status);
|
|
}
|
|
|
|
#define error(status, errnum, format...) \
|
|
error_at_line(status, errnum, NULL, 0, format)
|