File apcupsd-3.14.8-exit-race.patch of Package apcupsd

diff -up src/apcupsd.c.orig-race src/apcupsd.c
--- src/apcupsd.c.orig-race	2009-05-26 00:18:09.000000000 +0200
+++ src/apcupsd.c	2011-10-16 22:05:00.532772618 +0200
@@ -91,13 +91,14 @@ void apcupsd_terminate(int sig)
    if (sig != 0)
       log_event(ups, LOG_WARNING, _("apcupsd exiting, signal %u\n"), sig);
 
+   clean_threads();
+
    clear_files();
 
    device_close(ups);
 
    delete_lockfile(ups);
 
-   clean_threads();
    log_event(ups, LOG_WARNING, _("apcupsd shutdown succeeded"));
    destroy_ups(ups);
    closelog();
openSUSE Build Service is sponsored by