main.cpp revision 9e444e8b4f8b7949ab446705bf4e8f8c175a17ca
c39e02bbf326184d8f70d4d6f4fbceb8ea5b6b97vboxsync * VirtualBox Guest Service:
c39e02bbf326184d8f70d4d6f4fbceb8ea5b6b97vboxsync * Linux guest.
c39e02bbf326184d8f70d4d6f4fbceb8ea5b6b97vboxsync * Copyright (C) 2006-2007 Sun Microsystems, Inc.
c39e02bbf326184d8f70d4d6f4fbceb8ea5b6b97vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
c39e02bbf326184d8f70d4d6f4fbceb8ea5b6b97vboxsync * available from http://www.virtualbox.org. This file is free software;
c39e02bbf326184d8f70d4d6f4fbceb8ea5b6b97vboxsync * you can redistribute it and/or modify it under the terms of the GNU
c39e02bbf326184d8f70d4d6f4fbceb8ea5b6b97vboxsync * General Public License (GPL) as published by the Free Software
c39e02bbf326184d8f70d4d6f4fbceb8ea5b6b97vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
c39e02bbf326184d8f70d4d6f4fbceb8ea5b6b97vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
c39e02bbf326184d8f70d4d6f4fbceb8ea5b6b97vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
c39e02bbf326184d8f70d4d6f4fbceb8ea5b6b97vboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
c39e02bbf326184d8f70d4d6f4fbceb8ea5b6b97vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
c39e02bbf326184d8f70d4d6f4fbceb8ea5b6b97vboxsync * additional information or have any questions.
739c77783387df1b22501b27bd870869a865d20cvboxsync#define TRACE RTPrintf("%s: %d\n", __PRETTY_FUNCTION__, __LINE__); Log(("%s: %d\n", __PRETTY_FUNCTION__, __LINE__))
739c77783387df1b22501b27bd870869a865d20cvboxsyncstatic int (*gpfnOldIOErrorHandler)(Display *) = NULL;
c39e02bbf326184d8f70d4d6f4fbceb8ea5b6b97vboxsync/** Object representing the service we are running. This has to be global
c39e02bbf326184d8f70d4d6f4fbceb8ea5b6b97vboxsync * so that the cleanup routine can access it. */
c39e02bbf326184d8f70d4d6f4fbceb8ea5b6b97vboxsync/** The name of our pidfile. It is global for the benefit of the cleanup
c39e02bbf326184d8f70d4d6f4fbceb8ea5b6b97vboxsync * routine. */
c39e02bbf326184d8f70d4d6f4fbceb8ea5b6b97vboxsync/** The file handle of our pidfile. It is global for the benefit of the
c39e02bbf326184d8f70d4d6f4fbceb8ea5b6b97vboxsync * cleanup routine. */
c39e02bbf326184d8f70d4d6f4fbceb8ea5b6b97vboxsync/** Clean up if we get a signal or something. This is extern so that we
c39e02bbf326184d8f70d4d6f4fbceb8ea5b6b97vboxsync * can call it from other compilation units. */
739c77783387df1b22501b27bd870869a865d20cvboxsync * A standard signal handler which cleans up and exits.
739c77783387df1b22501b27bd870869a865d20cvboxsync Log(("VBoxClient: terminated with signal %d\n", cSignal));
c39e02bbf326184d8f70d4d6f4fbceb8ea5b6b97vboxsync /** Disable seamless mode */
c39e02bbf326184d8f70d4d6f4fbceb8ea5b6b97vboxsync * Xlib error handler for certain errors that we can't avoid.
c39e02bbf326184d8f70d4d6f4fbceb8ea5b6b97vboxsyncint vboxClientXLibErrorHandler(Display *pDisplay, XErrorEvent *pError)
LogRelFlow(("VBoxClient: an X Window protocol error occurred: %s (error code %d). Request code: %d, minor code: %d, serial number: %d\n", errorText, pError->error_code, pError->request_code, pError->minor_code, pError->serial));
Log(("VBoxClient: a fatal guest X Window error occurred. This may just mean that the Window system was shut down while the client was still running.\n"));
void vboxClientSetSignalHandlers(void)
RTPrintf("Usage: %s --clipboard|--display|--checkhostversion|--seamless [-d|--nodaemon]\n", pcszFileName);
# ifdef VBOX_WITH_GUEST_PROPS
exit(0);
bool fDaemonise = true;
bool fSuccess = true;
bool fHaveService = false;
RTR3Init();
fDaemonise = false;
fSuccess = false;
fSuccess = false;
fSuccess = false;
fSuccess = false;
exit(0);
if (fDaemonise)
# ifdef DEBUG
VbglR3Term();