diff --git a/cli.c b/cli.c index 7ea4fac..2226a1e 100644 --- a/cli.c +++ b/cli.c @@ -195,7 +195,7 @@ struct cli_options *cli_options_parse(int argc, char *argv[]) { } if (res->vmnet_gateway == NULL) { if (res->vmnet_mode != VMNET_BRIDGED_MODE) { - ERROR("WARNING: --vmnet-gateway=IP should be explicitly specified to " + WARN("--vmnet-gateway=IP should be explicitly specified to " "avoid conflicting with other applications"); } if (res->vmnet_dhcp_end != NULL) { diff --git a/log.h b/log.h index 7c5059a..348e725 100644 --- a/log.h +++ b/log.h @@ -13,5 +13,8 @@ extern bool debug; #define ERROR(msg) fprintf(stderr, "ERROR| " msg "\n") #define ERRORF(fmt, ...) fprintf(stderr, "ERROR| " fmt "\n", __VA_ARGS__) #define ERRORN(name) ERRORF(name ": %s", strerror(errno)) +#define WARN(msg) fprintf(stderr, "WARN | " msg "\n") +#define WARNF(fmt, ...) fprintf(stderr, "WARN | " fmt "\n", __VA_ARGS__) + #endif /* SOCKET_VMNET_LOG_H */ diff --git a/main.c b/main.c index a05a2b0..628bb1c 100644 --- a/main.c +++ b/main.c @@ -400,12 +400,10 @@ int main(int argc, char *argv[]) { struct cli_options *cliopt = cli_options_parse(argc, argv); assert(cliopt != NULL); if (geteuid() != 0) { - ERROR("WARNING: Running without root. This is very unlikely to " - "work: See README.md"); + WARN("Running without root. This is very unlikely to work: See README.md"); } if (geteuid() != getuid()) { - ERROR("WARNING: Seems running with SETUID. This is insecure and " - "highly discouraged: See README.md"); + WARN("Seems running with SETUID. This is insecure and highly discouraged: See README.md"); } if (sigsetjmp(jmpbuf, 1) != 0) {