From ae9b50a499b608778e83ffb9141e3649dbd2e6ac Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Sun, 2 Sep 2001 23:58:15 +0000 Subject: [PATCH] handle atexit or on_exit git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@10635 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/roken/write_pid.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/roken/write_pid.c b/lib/roken/write_pid.c index e5a93e1e9..bc51d8261 100644 --- a/lib/roken/write_pid.c +++ b/lib/roken/write_pid.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999 - 2000 Kungliga Tekniska Högskolan + * Copyright (c) 1999 - 2001 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -90,6 +90,10 @@ pidfile(const char *basename) if(basename == NULL) basename = getprogname(); pidfile_path = pid_file_write(basename); +#if defined(HAVE_ATEXIT) atexit(pidfile_cleanup); +#elif defined(HAVE_ON_EXIT) + on_exit(pidfile_cleanup); +#endif } #endif