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:
Assar Westerlund
2001-09-02 23:58:15 +00:00
parent 01f6c8e067
commit ae9b50a499

View File

@@ -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