]> xenbits.xensource.com Git - pvdrivers/win/xencons.git/commitdiff
Add option to not spawn child process.
authorOwen Smith <owen.smith@citrix.com>
Tue, 25 Jul 2017 13:13:19 +0000 (14:13 +0100)
committerPaul Durrant <paul.durrant@citrix.com>
Tue, 25 Jul 2017 13:13:19 +0000 (14:13 +0100)
If the "Executable" registry parameter is not found, do not spawn
a child process instead of failing.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
Removed unnecessary hunk checking value for NULL before passing to
free().

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
src/monitor/monitor.c

index 90c39b74ab7c0712d0950abf9b2dfc63e14ddf0e..3e535e4e1b4b51f51c8c354c46d2cf3668193c90 100644 (file)
@@ -597,6 +597,10 @@ MonitorThread(
 
     Log("====>");
 
+    // If there is no executable, this thread can finish now.
+    if (Context->Executable == NULL)
+        goto done;
+
 again:
     ZeroMemory(&ProcessInfo, sizeof (ProcessInfo));
     ZeroMemory(&StartupInfo, sizeof (StartupInfo));
@@ -649,6 +653,7 @@ again:
 
 //#undef WAIT_OBJECT_1
 
+done:
     Log("<====");
 
     return 0;
@@ -1272,7 +1277,7 @@ MonitorMain(
 
     Success = GetExecutable(&Context->Executable);
     if (!Success)
-        goto fail7;
+        Context->Executable = NULL;
 
     Context->Device = INVALID_HANDLE_VALUE;
 
@@ -1286,7 +1291,7 @@ MonitorMain(
                                    &Interface,
                                    DEVICE_NOTIFY_SERVICE_HANDLE);
     if (Context->InterfaceNotification == NULL)
-        goto fail8;
+        goto fail7;
 
     // The device may already by present
     SetEvent(Context->AddEvent);
@@ -1356,11 +1361,6 @@ done:
 
     return;
 
-fail8:
-    Log("fail8");
-
-    free(Context->Executable);
-
 fail7:
     Log("fail7");