Use Better Exit Codes

This commit is contained in:
TheBrokenRail 2020-11-19 14:52:41 -05:00
parent 1d14cc5059
commit a39476228e
3 changed files with 4 additions and 4 deletions

View File

@ -72,7 +72,7 @@ static void load(char **ld_path, char **ld_preload, char *folder) {
} else if (errno != 0) {
// Error Reading Contents Of Folder
fprintf(stderr, "Error Reading Directory: %s\n", strerror(errno));
exit(1);
exit(EXIT_FAILURE);
} else {
break;
}
@ -94,7 +94,7 @@ static void load(char **ld_path, char **ld_preload, char *folder) {
} else {
// Unable To Open Folder
fprintf(stderr, "Error Opening Directory: %s\n", strerror(errno));
exit(1);
exit(EXIT_FAILURE);
}
}
}

View File

@ -11,7 +11,7 @@ extern "C" {
#include <dlfcn.h>
#define INFO(msg, ...) fprintf(stderr, "[INFO]: " msg "\n", __VA_ARGS__);
#define ERR(msg, ...) fprintf(stderr, "[ERR]: " msg "\n", __VA_ARGS__); exit(1);
#define ERR(msg, ...) fprintf(stderr, "[ERR]: " msg "\n", __VA_ARGS__); exit(EXIT_FAILURE);
#define HOOK(name, return_type, args) \
typedef return_type (*name##_t)args; \

View File

@ -1,6 +1,6 @@
#ifndef CXX_11_UTIL_H
#define CXX_11_UTIL
#define CXX_11_UTIL_H
#ifdef __cplusplus
extern "C" {