mirror of
https://github.com/darkk/redsocks.git
synced 2025-08-26 19:55:30 +00:00
s/return 0/return EXIT_SUCCESS/, s/return 1/return EXIT_FAILURE/.
This commit is contained in:
parent
8456d20883
commit
36dc692ab3
11
main.c
11
main.c
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include <event.h>
|
#include <event.h>
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
@ -24,13 +25,13 @@ int main(int argc, char **argv)
|
|||||||
FILE *f = fopen("redsocks.conf", "r");
|
FILE *f = fopen("redsocks.conf", "r");
|
||||||
if (!f) {
|
if (!f) {
|
||||||
perror("Unable to open config file");
|
perror("Unable to open config file");
|
||||||
return 1;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
parser_context* parser = parser_start(f, NULL);
|
parser_context* parser = parser_start(f, NULL);
|
||||||
if (!parser) {
|
if (!parser) {
|
||||||
perror("Not enough memory for parser");
|
perror("Not enough memory for parser");
|
||||||
return 1;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
FOREACH(ss, subsystems)
|
FOREACH(ss, subsystems)
|
||||||
@ -40,7 +41,7 @@ int main(int argc, char **argv)
|
|||||||
parser_stop(parser);
|
parser_stop(parser);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
if (error)
|
if (error)
|
||||||
return 1;
|
return EXIT_FAILURE;
|
||||||
|
|
||||||
event_init();
|
event_init();
|
||||||
|
|
||||||
@ -52,7 +53,7 @@ int main(int argc, char **argv)
|
|||||||
for (--ss; ss >= subsystems; ss--)
|
for (--ss; ss >= subsystems; ss--)
|
||||||
if ((*ss)->fini)
|
if ((*ss)->fini)
|
||||||
(*ss)->fini();
|
(*ss)->fini();
|
||||||
return 1;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,7 +64,7 @@ int main(int argc, char **argv)
|
|||||||
FOREACH_REV(ss, subsystems)
|
FOREACH_REV(ss, subsystems)
|
||||||
if ((*ss)->fini)
|
if ((*ss)->fini)
|
||||||
(*ss)->fini();
|
(*ss)->fini();
|
||||||
return 0;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* vim:set tabstop=4 softtabstop=4 shiftwidth=4: */
|
/* vim:set tabstop=4 softtabstop=4 shiftwidth=4: */
|
||||||
|
Loading…
Reference in New Issue
Block a user