VirtualBox

Changeset 99660 in vbox


Ignore:
Timestamp:
May 8, 2023 9:47:22 AM (19 months ago)
Author:
vboxsync
Message:

Guest Additions/VBoxClient: Repaired setting the g_fDaemonized flag, added better error handling for daemonizing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/VBoxClient/main.cpp

    r99658 r99660  
    103103/** Critical section for the signal handler. */
    104104static RTCRITSECT      g_csSignalHandler;
    105 /** Flag indicating Whether the service starts in daemonized  mode or not. */
     105/** Flag indicating Whether the service starts in daemonized mode or not. */
    106106bool                   g_fDaemonized = false;
    107107/** The name of our pidfile.  It is global for the benefit of the cleanup
     
    787787    if (fDaemonise)
    788788    {
     789        VBClLogInfo("Daemonizing service ...\n");
    789790        rc = VbglR3DaemonizeEx(false /* fNoChDir */, false /* fNoClose */, fRespawn, &g_cRespawn,
    790791                               true /* fReturnOnUpdate */, &fUpdateStarted, g_szControlPidFile, &g_hControlPidFile);
    791         /* This combination only works in context of parent process. */
    792         if (RT_SUCCESS(rc) && fUpdateStarted)
    793             vbclHandleUpdateStarted(argv);
    794     }
    795 
    796     if (RT_FAILURE(rc))
    797         VBClLogFatalError("Daemonizing service failed: %Rrc\n", rc);
     792        if (RT_SUCCESS(rc))
     793        {
     794            g_fDaemonized = true;
     795
     796            if (fUpdateStarted) /* This combination only works in context of parent process. */
     797                vbclHandleUpdateStarted(argv);
     798        }
     799        else
     800            return RTMsgErrorExitFailure("Daemonizing service failed: %Rrc\n", rc);
     801    }
    798802
    799803    if (g_szPidFile[0])
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette