VirtualBox

Ignore:
Timestamp:
Jul 8, 2021 2:37:49 PM (4 years ago)
Author:
vboxsync
Message:

Reverted r145598 (Audio/ValKit: Use RTProcDaemonizeUsingFork() and also added PID file support to VKAT / VBoxAudioTest) -- IPRT only has this implementation for POSIX so far. bugref:10008

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/utils/audio/vkat.cpp

    r90098 r90100  
    129129    VKAT_TEST_OPT_PCM_CHAN,
    130130    VKAT_TEST_OPT_PCM_SIGNED,
    131     VKAT_TEST_OPT_PIDFILE,
    132131    VKAT_TEST_OPT_TAG,
    133132    VKAT_TEST_OPT_TEMPDIR,
     
    178177    { "--pcm-hz",            VKAT_TEST_OPT_PCM_HZ,         RTGETOPT_REQ_UINT16  },
    179178    { "--pcm-signed",        VKAT_TEST_OPT_PCM_SIGNED,     RTGETOPT_REQ_BOOL    },
    180     { "--pidfile",           VKAT_TEST_OPT_PIDFILE,        RTGETOPT_REQ_STRING  },
    181179    { "--mode",              VKAT_TEST_OPT_MODE,           RTGETOPT_REQ_STRING  },
    182180    { "--no-verify",         VKAT_TEST_OPT_NO_VERIFY,      RTGETOPT_REQ_NOTHING },
     
    648646        case VKAT_TEST_OPT_PCM_CHAN:       return "Specifies the number of PCM channels to use [2]";
    649647        case VKAT_TEST_OPT_PCM_SIGNED:     return "Specifies whether to use signed (true) or unsigned (false) samples [true]";
    650         case VKAT_TEST_OPT_PIDFILE:        return "Specifies the PID file to use (for daemonizing)";
    651648        case VKAT_TEST_OPT_TAG:            return "Specifies the test set tag to use";
    652649        case VKAT_TEST_OPT_TEMPDIR:        return "Specifies the temporary directory to use";
     
    679676    bool        fPcmSigned    = true;
    680677
    681     const char *pszPidFile    = NULL;
    682678    bool        fDaemonize    = false;
    683679    bool        fDaemonized   = false;
     
    789785                break;
    790786
    791             case VKAT_TEST_OPT_PIDFILE:
    792                 pszPidFile = ValueUnion.psz;
    793                 break;
    794 
    795787            case VKAT_TEST_OPT_TAG:
    796788                pszTag = ValueUnion.psz;
     
    824816        {
    825817            if (g_uVerbosity > 0)
    826             {
    827                 RTMsgInfo("Starting in background (as daemon) ...");
    828                 if (pszPidFile)
    829                     RTMsgInfo("Using PID file '%s'", pszPidFile);
    830             }
    831             rc = RTProcDaemonizeUsingFork(true /* fNoChDir */, false /* fNoClose */, pszPidFile);
     818                RTMsgInfo("Daemonizing...");
     819            rc = RTProcDaemonize(pGetState->argv, "--daemonized");
    832820            if (RT_FAILURE(rc))
    833                 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to daemonize: %Rrc\n", rc);
     821                return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTProcDaemonize: %Rrc\n", rc);
     822            return RTEXITCODE_SUCCESS;
    834823        }
    835824        else
    836825        {
    837826            if (g_uVerbosity > 0)
    838                 RTMsgInfo("Running in background (as daemon) ...");
     827                RTMsgInfo("Running daemonized ...");
    839828        }
    840829    }
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