afsd-service-shutdown-crash-20040325
authorJeffrey Altman <jaltman@mit.edu>
Thu, 25 Mar 2004 19:37:41 +0000 (19:37 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 25 Mar 2004 19:37:41 +0000 (19:37 +0000)
More fixes to the afsd client service which do not result in solving
the problem but still should be done.

src/WINNT/afsd/afsd_service.c

index 5580be9..0cc4387 100644 (file)
@@ -489,24 +489,22 @@ void afsd_Main(DWORD argc, LPTSTR *argv)
        ServiceStatus.dwWaitHint = 0;
        ServiceStatus.dwControlsAccepted = 0;
        SetServiceStatus(StatusHandle, &ServiceStatus);
-    return;
 }
 
 DWORD __stdcall afsdMain_thread(void* notUsed)
 {
        afsd_Main(0, (LPTSTR*)NULL);
-    return(0);
+    exit(0);
 }
 
-void main()
+int
+main(void)
 {
-       SERVICE_TABLE_ENTRY dispatchTable[] = {
+       static SERVICE_TABLE_ENTRY dispatchTable[] = {
                {AFS_DAEMON_SERVICE_NAME, (LPSERVICE_MAIN_FUNCTION) afsd_Main},
                {NULL, NULL}
        };
 
-    afsd_SetUnhandledExceptionFilter();
-
        if (!StartServiceCtrlDispatcher(dispatchTable))
     {
         LONG status = GetLastError();
@@ -520,4 +518,5 @@ void main()
             SetEvent(WaitToTerminate);
         }
     }
+    return(0);
 }