VirtualBox

Ignore:
Timestamp:
Sep 5, 2011 1:49:45 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
73843
Message:

*,IPRT: Redid the ring-3 init to always convert the arguments to UTF-8.

Location:
trunk/src/VBox/Additions/x11/VBoxClient
Files:
3 edited

Legend:

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

    r35617 r38636  
    3030#include <iprt/env.h>
    3131#include <iprt/initterm.h>
     32#include <iprt/message.h>
    3233#include <iprt/path.h>
    3334#include <iprt/param.h>
     
    159160int main(int argc, char *argv[])
    160161{
    161     int rcClipboard, rc;
     162    /* Initialise our runtime before all else. */
     163    int rc = RTR3InitExe(argc, &argv, 0);
     164    if (RT_FAILURE(rc))
     165        return RTMsgInitFailure(rc);
     166
     167    int rcClipboard;
    162168    const char *pszFileName = RTPathFilename(argv[0]);
    163169    bool fDaemonise = true;
     
    170176        pszFileName = "VBoxClient";
    171177
    172     /* Initialise our runtime before all else. */
    173     rc = RTR3Init();
    174     if (RT_FAILURE(rc))
    175     {
    176         /* Of course, this should never happen. */
    177         RTPrintf("%s: Failed to initialise the run-time library, rc=%Rrc\n", pszFileName, rc);
    178         exit(1);
    179     }
    180 
    181178    /* Initialise our global clean-up critical section */
    182179    rc = RTCritSectInit(&g_critSect);
     
    185182        /* Of course, this should never happen. */
    186183        RTPrintf("%s: Failed to initialise the global critical section, rc=%Rrc\n", pszFileName, rc);
    187         exit(1);
     184        return 1;
    188185    }
    189186
     
    225222        {
    226223            vboxClientUsage(pszFileName);
    227             exit(0);
     224            return 0;
    228225        }
    229226        else
     
    231228            RTPrintf("%s: unrecognized option `%s'\n", pszFileName, argv[i]);
    232229            RTPrintf("Try `%s --help' for more information\n", pszFileName);
    233             exit(1);
     230            return 1;
    234231        }
    235232    }
     
    237234    {
    238235        vboxClientUsage(pszFileName);
    239         exit(1);
     236        return 1;
    240237    }
    241238    /* Get the path for the pidfiles */
  • trunk/src/VBox/Additions/x11/VBoxClient/testcase/tstSeamlessX11-auto.cpp

    r37173 r38636  
    685685int main( int argc, char **argv)
    686686{
    687     RTR3Init();
     687    RTR3InitExe(argc, &argv, 0);
    688688    unsigned cErrs = 0;
    689689    g_pszTestName = RTPathFilename(argv[0]);
  • trunk/src/VBox/Additions/x11/VBoxClient/testcase/tstSeamlessX11.cpp

    r36808 r38636  
    107107    char ach[2];
    108108
    109     RTR3Init();
     109    RTR3InitExe(argc, &argv, 0);
    110110    RTPrintf("VirtualBox guest additions X11 seamless mode testcase\n");
    111111    if (0 == XInitThreads())
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