VirtualBox

Changeset 52231 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Jul 29, 2014 7:54:57 PM (10 years ago)
Author:
vboxsync
Message:

Additions/x11/VBoxClient: make fatal error notification application-global.

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

Legend:

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

    r50496 r52231  
    1919# define ___vboxclient_vboxclient_h
    2020
     21#include <VBox/log.h>
    2122#include <iprt/cpp/utils.h>
     23#include <iprt/string.h>
     24
     25/** Exit with a fatal error. */
     26#define FatalError(format) \
     27do { \
     28    char *pszMessage = RTStrAPrintf2 format; \
     29    LogRel(format); \
     30    doFatalError(pszMessage); \
     31} while(0)
     32
     33/** Exit with a fatal error. */
     34extern void doFatalError(char *pszMessage);
    2235
    2336/** Namespace for VBoxClient-specific things */
  • trunk/src/VBox/Additions/x11/VBoxClient/display.cpp

    r52189 r52231  
    5757    long *paSizeHints;
    5858};
    59 
    60 /** Exit with a fatal error.
    61  * @todo Make this application global. */
    62 #define FatalError(format) \
    63 do { \
    64     char *pszMessage = RTStrAPrintf2 format; \
    65     LogRel(format); \
    66     doFatalError(pszMessage); \
    67 } while(0)
    68 
    69 static void doFatalError(char *pszMessage)
    70 {
    71     char *pszCommand;
    72     if (pszMessage)
    73     {
    74         pszCommand = RTStrAPrintf2("notify-send \"VBoxClient: %s\"",
    75                                    pszMessage);
    76         if (pszCommand)
    77             system(pszCommand);
    78     }
    79     exit(1);
    80 }
    8159
    8260/** Tell the VBoxGuest driver we no longer want any events and tell the host
  • trunk/src/VBox/Additions/x11/VBoxClient/main.cpp

    r50464 r52231  
    6060 */
    6161RTCRITSECT g_critSect;
     62
     63/** Exit with a fatal error. */
     64void doFatalError(char *pszMessage)
     65{
     66    char *pszCommand;
     67    if (pszMessage)
     68    {
     69        pszCommand = RTStrAPrintf2("notify-send \"VBoxClient: %s\"",
     70                                   pszMessage);
     71        if (pszCommand)
     72            system(pszCommand);
     73    }
     74    exit(1);
     75}
    6276
    6377/** Clean up if we get a signal or something.  This is extern so that we
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