handle atexit or on_exit
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@10635 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user