Annotation of embedaddon/ntp/ports/winnt/libntp/mexit.c, revision 1.1.1.1

1.1       misho       1: /*
                      2:  * mexit - Used to exit the NTPD daemon
                      3:  * 
                      4:  */
                      5: 
                      6: #include <windows.h>
                      7: #include <stdio.h>
                      8: 
                      9: HANDLE hServDoneEvent = NULL;
                     10: 
                     11: void
                     12: service_exit(
                     13:        int status
                     14:        )
                     15: {
                     16:        extern int debug;
                     17: 
                     18:        if (debug) /* did not become a service, simply exit */
                     19:            ExitThread((DWORD)status);
                     20:        else {
                     21:                /* service mode, need to have the service_main routine
                     22:                 * register with the service control manager that the 
                     23:                 * service has stopped running, before exiting
                     24:                 */
                     25:                if ((status > 0) && (hServDoneEvent != NULL))
                     26:                    SetEvent(hServDoneEvent);
                     27:                ExitThread((DWORD)status);
                     28:        }
                     29: }
                     30: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>