VirtualBox

Changeset 30439 in vbox


Ignore:
Timestamp:
Jun 24, 2010 3:53:22 PM (15 years ago)
Author:
vboxsync
Message:

Backed out r63009 (not needed, see #5068c14).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3Lib.cpp

    r30392 r30439  
    55
    66/*
    7  * Copyright (C) 2007-2010 Oracle Corporation
     7 * Copyright (C) 2007 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4444# if defined(RT_OS_LINUX) /** @todo check this on solaris+freebsd as well. */
    4545#  include <sys/ioctl.h>
    46 # endif
    47 # if defined(RT_OS_SOLARIS) && !defined(VBOX_VBGLR3_XFREE86)
    48 #  define VBGL_DO_MASK_SIGNALS
    49 #  include <signal.h>
    5046# endif
    5147# include <errno.h>
     
    293289
    294290
    295 /*
    296  * Helper macros for blocking and restoring signals.
    297  */
    298 #ifdef VBGL_DO_MASK_SIGNALS
    299 # define BLOCK_SIGNALS(Prf) \
    300     int         Prf##_rcSig; \
    301     sigset_t    Prf##_SigSetOld; \
    302     do \
    303     { \
    304         sigset_t Prf##_SigSetNew; \
    305         sigfillset(& Prf##_SigSetNew); \
    306         sigdelset(& Prf##_SigSetNew, SIGTERM); \
    307         sigdelset(& Prf##_SigSetNew, SIGINT); \
    308         sigdelset(& Prf##_SigSetNew, SIGHUP); \
    309         sigdelset(& Prf##_SigSetNew, SIGABRT); \
    310         sigdelset(& Prf##_SigSetNew, SIGKILL); \
    311         Prf##_rcSig = pthread_sigmask(SIG_BLOCK, & Prf##_SigSetNew, & Prf##_SigSetOld); \
    312     } while (0)
    313 
    314 # define RESTORE_SIGNALS(Prf) \
    315     do \
    316     { \
    317         if (Prf##_rcSig == 0) \
    318         { \
    319             int Prf##_err = errno; /* paranoia */ \
    320             pthread_sigmask(SIG_SETMASK, & Prf##_SigSetOld, NULL); \
    321             errno = Prf##_err; \
    322         } \
    323     } while (0)
    324 
    325 #else
    326 # define BLOCK_SIGNALS(Prf)     do { } while (0)
    327 # define RESTORE_SIGNALS(Prf)   do { } while (0)
    328 #endif
    329 
    330 
    331291/**
    332292 * Internal wrapper around various OS specific ioctl implemenations.
     
    385345 *        header with an error code return field (much better alternative
    386346 *        actually). */
    387     BLOCK_SIGNALS(SigPrefix);
    388347    int rc = ioctl((int)g_File, iFunction, &Hdr);
    389     RESTORE_SIGNALS(SigPrefix);
    390348    if (rc == -1)
    391349    {
     
    396354
    397355#elif defined(RT_OS_LINUX)
    398     BLOCK_SIGNALS(SigPrefix);
    399356# ifdef VBOX_VBGLR3_XFREE86
    400357    int rc = xf86ioctl((int)g_File, iFunction, pvData);
     
    402359    int rc = ioctl((int)g_File, iFunction, pvData);
    403360# endif
    404     RESTORE_SIGNALS(SigPrefix);
    405361    if (RT_LIKELY(rc == 0))
    406362        return VINF_SUCCESS;
     
    421377    /* PORTME - This is preferred over the RTFileIOCtl variant below, just be careful with the (int). */
    422378/** @todo test status code passing! */
    423     BLOCK_SIGNALS(SigPrefix);
    424379    int rc = xf86ioctl(g_File, iFunction, pvData);
    425     RESTORE_SIGNALS(SigPrefix);
    426380    if (rc == -1)
    427381        return VERR_FILE_IO_ERROR;  /* This is purely legacy stuff, it has to work and no more. */
     
    431385    /* Default implementation - PORTME: Do not use this without testings that passing errors works! */
    432386/** @todo test status code passing! */
    433     BLOCK_SIGNALS(SigPrefix);
    434387    int rc2 = VERR_INTERNAL_ERROR;
    435388    int rc = RTFileIoCtl(g_File, (int)iFunction, pvData, cbData, &rc2);
    436     RESTORE_SIGNALS(SigPrefix);
    437389    if (RT_SUCCESS(rc))
    438390        rc = rc2;
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