summaryrefslogtreecommitdiff
path: root/src/starter/starter.c
diff options
context:
space:
mode:
authorRene Mayrhofer <rene@mayrhofer.eu.org>2007-07-04 23:47:20 +0000
committerRene Mayrhofer <rene@mayrhofer.eu.org>2007-07-04 23:47:20 +0000
commit7b0305f59ddab9ea026b202a8c569912e5bf9a90 (patch)
tree131d39a22cf97e9e8c6da58ddefabc8138a731c2 /src/starter/starter.c
parent08ee5250bd9c43fda5f24d10b791ca2c4c17fcee (diff)
downloadvyos-strongswan-7b0305f59ddab9ea026b202a8c569912e5bf9a90.tar.gz
vyos-strongswan-7b0305f59ddab9ea026b202a8c569912e5bf9a90.zip
[svn-upgrade] Integrating new upstream version, strongswan (4.1.4)
Diffstat (limited to 'src/starter/starter.c')
-rw-r--r--src/starter/starter.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/starter/starter.c b/src/starter/starter.c
index 0bf1d7a71..3cf7017fd 100644
--- a/src/starter/starter.c
+++ b/src/starter/starter.c
@@ -237,9 +237,13 @@ int main (int argc, char **argv)
}
cfg = confread_load(CONFIG_FILE);
- if (!cfg)
+ if (cfg == NULL || cfg->err > 0)
{
- plog("unable to start strongSwan -- errors in config");
+ plog("unable to start strongSwan -- fatal errors in config");
+ if (cfg)
+ {
+ confread_free(cfg);
+ }
exit(1);
}
@@ -276,6 +280,7 @@ int main (int argc, char **argv)
dup2(fnull, STDERR_FILENO);
close(fnull);
}
+ setsid();
}
break;
case -1:
@@ -372,7 +377,7 @@ int main (int argc, char **argv)
);
new_cfg = confread_load(CONFIG_FILE);
- if (new_cfg)
+ if (new_cfg->err + new_cfg->non_fatal_err == 0)
{
/* Switch to new config. New conn will be loaded below */
if (!starter_cmp_defaultroute(&new_cfg->defaultroute
@@ -465,7 +470,8 @@ int main (int argc, char **argv)
}
else
{
- plog("can't reload config file: %s -- keeping old one");
+ plog("can't reload config file due to errors -- keeping old one");
+ confread_free(new_cfg);
}
_action_ &= ~FLAG_ACTION_UPDATE;
last_reload = time(NULL);