VirtualBox

Changeset 40046 in vbox


Ignore:
Timestamp:
Feb 9, 2012 9:41:03 AM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
76172
Message:

RTProcDaemonizeUsingFork: close pidfile handle in some error cases

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/posix/process-creation-posix.cpp

    r39083 r40046  
    655655    pid_t pid = fork();
    656656    if (pid == -1)
     657    {
     658        if (fdPidfile != -1)
     659            close(fdPidfile);
    657660        return RTErrConvertFromErrno(errno);
     661    }
    658662    if (pid != 0)
    659663    {
     
    673677        sigaction(SIGHUP, &OldSigAct, NULL);
    674678    if (newpgid == -1)
     679    {
     680        if (fdPidfile != -1)
     681            close(fdPidfile);
    675682        return RTErrConvertFromErrno(SavedErrno);
     683    }
    676684
    677685    if (!fNoClose)
     
    705713    pid = fork();
    706714    if (pid == -1)
     715    {
     716        if (fdPidfile != -1)
     717            close(fdPidfile);
    707718        return RTErrConvertFromErrno(errno);
     719    }
    708720
    709721    if (pid != 0)
     
    720732    }
    721733
     734    if (fdPidfile != -1)
     735        close(fdPidfile);
     736
    722737    return VINF_SUCCESS;
    723738}
Note: See TracChangeset for help on using the changeset viewer.

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