Windows: log error code for smb lan thread fail
authorJeffrey Altman <jaltman@your-file-system.com>
Sun, 12 Dec 2010 04:28:02 +0000 (23:28 -0500)
committerJeffrey Altman <jaltman@openafs.org>
Mon, 13 Dec 2010 15:49:51 +0000 (07:49 -0800)
When creation of the smb_LanAdapterChangeThread fails
log the error code as part of the panic message.

Change-Id: Iac034bdf2f04aed08cf77702c701882c31a10b36
Reviewed-on: http://gerrit.openafs.org/3502
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

src/WINNT/afsd/smb.c

index e806385..9384c81 100644 (file)
@@ -10295,7 +10295,16 @@ void smb_SetLanAdapterChangeDetected(void)
     if (!powerStateSuspended) {
         phandle = thrd_Create(NULL, 65536, (ThreadFunc) smb_LanAdapterChangeThread,
                               NULL, 0, &lpid, "smb_LanAdapterChange");
-        osi_assertx(phandle != NULL, "smb_LanAdapterChangeThread thread creation failure");
+        if (phandle == NULL) {
+            DWORD gle;
+            char msg[128];
+
+            gle = GetLastError();
+            StringCchPrintf( msg, sizeof(msg)/sizeof(msg[0]),
+                             "smb_LanAdapterChangeThread thread creation failure - gle 0x%x",
+                             gle);
+            osi_assertx(TRUE, msg);
+        }
         thrd_CloseHandle(phandle);
     }