projects
/
srvx.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix possible crash on user deletion
[srvx.git]
/
src
/
main.c
diff --git
a/src/main.c
b/src/main.c
index ec0bde8985d4bb2e3d416581c1dd002fe27ab27b..4b8c71464550958b7b1895a5dd88a6e6d8d99908 100644
(file)
--- a/
src/main.c
+++ b/
src/main.c
@@
-33,6
+33,7
@@
#include "global.h"
#include "modules.h"
#include "opserv.h"
#include "global.h"
#include "modules.h"
#include "opserv.h"
+#include "spamserv.h"
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#ifdef HAVE_GETOPT_H
#include <getopt.h>
@@
-101,7
+102,8
@@
gc_warn_proc(char *msg, GC_word arg)
int main(int argc, char *argv[])
{
int main(int argc, char *argv[])
{
- int daemon, debug;
+ int run_as_daemon;
+ int debug;
pid_t pid = 0;
FILE *file_out;
struct sigaction sv;
pid_t pid = 0;
FILE *file_out;
struct sigaction sv;
@@
-112,7
+114,7
@@
int main(int argc, char *argv[])
GC_enable_incremental();
#endif
GC_enable_incremental();
#endif
- daemon = 1;
+
run_as_
daemon = 1;
debug = 0;
tools_init();
debug = 0;
tools_init();
@@
-168,7
+170,7
@@
int main(int argc, char *argv[])
debug = 1;
break;
case 'f':
debug = 1;
break;
case 'f':
- daemon = 0;
+
run_as_
daemon = 0;
break;
case 'v':
version();
break;
case 'v':
version();
@@
-202,7
+204,7
@@
int main(int argc, char *argv[])
conf_register_reload(uplink_compile);
conf_register_reload(uplink_compile);
- if (daemon) {
+ if (
run_as_
daemon) {
/* Attempt to fork into the background if daemon mode is on. */
pid = fork();
if (pid < 0) {
/* Attempt to fork into the background if daemon mode is on. */
pid = fork();
if (pid < 0) {
@@
-223,7
+225,7
@@
int main(int argc, char *argv[])
fclose(file_out);
}
fclose(file_out);
}
- if (daemon) {
+ if (
run_as_
daemon) {
/* Close these since we should not use them from now on. */
fclose(stdin);
fclose(stdout);
/* Close these since we should not use them from now on. */
fclose(stdin);
fclose(stdout);