implement error() for musl
This commit is contained in:
parent
5771108fed
commit
d3fce5edd4
@ -6,12 +6,28 @@
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <error.h>
|
||||
#include <signal.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef _GNU_SOURCE
|
||||
#include <error.h>
|
||||
#else
|
||||
#include <stdarg.h>
|
||||
static void error(int status, int errnum, const char * fmt, ...) {
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
|
||||
fprintf(stderr, "logtee: ");
|
||||
vfprintf(stderr, fmt, ap);
|
||||
if(errnum) fprintf(stderr, ": %s", strerror(errnum));
|
||||
fprintf(stderr, "\n");
|
||||
if(status) exit(status);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
int open_shipper_socket(char *pathname) {
|
||||
int fd;
|
||||
static int fail_count = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user