aboutsummaryrefslogtreecommitdiff
path: root/src/runscript.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-07-04 16:02:01 +0000
committerRoy Marples <roy@marples.name>2007-07-04 16:02:01 +0000
commitf28763d4928a5ffb2c288388299ccf69ee26f26e (patch)
treefb84a019286f470bdb41c1370634ef229371e393 /src/runscript.c
parent46156cc8cdfcdcc676d5d5d0a1a753978e412018 (diff)
As we're running each plugin in a fork, we need to call our cleanup code so we don't leak memory. To this extent, we now have the global boolean rc_in_plugin and the cleanup code can act accordingly.
Diffstat (limited to 'src/runscript.c')
-rw-r--r--src/runscript.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/runscript.c b/src/runscript.c
index ad2d69a8..94df6fcc 100644
--- a/src/runscript.c
+++ b/src/runscript.c
@@ -234,7 +234,7 @@ static void start_services (char **list) {
static void cleanup (void)
{
- if (prefix_locked)
+ if (! rc_in_plugin && prefix_locked)
unlink (PREFIX_LOCK);
/* Flush our buffered output if any */
@@ -259,7 +259,7 @@ static void cleanup (void)
rc_strlist_free (tmplist);
free (ibsave);
- if (in_control ()) {
+ if (! rc_in_plugin && in_control ()) {
if (rc_service_state (applet, rc_service_stopping)) {
/* If the we're shutting down, do it cleanly */
if ((softlevel &&
@@ -287,7 +287,8 @@ static void cleanup (void)
if (mtime_test)
{
- unlink (mtime_test);
+ if (! rc_in_plugin)
+ unlink (mtime_test);
free (mtime_test);
}
free (exclusive);