summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f2c53b7)
raw | patch | inline | side by side (parent: f2c53b7)
author | Sebastian Harl <sh@tokkee.org> | |
Thu, 29 May 2008 22:09:18 +0000 (00:09 +0200) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Tue, 3 Jun 2008 14:31:05 +0000 (16:31 +0200) |
There is no reason to shutdown collectd completely just because of some
Perl specific error. An error message is logged in this case, so the user
has means to detect it.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Perl specific error. An error message is logged in this case, so the user
has means to detect it.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
src/perl.c | patch | blob | history |
diff --git a/src/perl.c b/src/perl.c
index bd6345baf4d8790effb3f579dbf2f2a4e3a3a92a..9bd3b4d200d255d242cdf2d1694a92b631ca3202 100644 (file)
--- a/src/perl.c
+++ b/src/perl.c
log_err ("init_pi: pthread_key_create failed");
/* this must not happen - cowardly giving up if it does */
- exit (1);
+ return -1;
}
#ifdef __FreeBSD__
if (0 != perl_parse (aTHX_ xs_init, argc, argv, NULL)) {
log_err ("init_pi: Unable to bootstrap Collectd.");
- exit (1);
+
+ perl_destruct (perl_threads->head->interp);
+ perl_free (perl_threads->head->interp);
+ sfree (perl_threads);
+
+ pthread_key_delete (perl_thr_key);
+ return -1;
}
/* Set $0 to "collectd" because perl_parse() has to set it to "-e". */
return (1);
}
- init_pi (perl_argc, perl_argv);
+ if (0 != init_pi (perl_argc, perl_argv))
+ return -1;
+
assert (NULL != perl_threads);
assert (NULL != perl_threads->head);