Ticket #78: 0004-Protect-signals-not-present-on-OS-X.patch

File 0004-Protect-signals-not-present-on-OS-X.patch, 2.4 KB (added by chuck@…, 13 years ago)

Protect signals not present on OS X

  • applications/rasql/rasql_signal.cc

    From 140caffef17f6e5dbd722eb68e8d7dd96cd7a9ba Mon Sep 17 00:00:00 2001
    From: Charlie Sharpsteen <source@sharpsteen.net>
    Date: Wed, 9 Nov 2011 22:02:12 -0800
    Subject: [PATCH 4/4] Protect signals not present on OS X
    
    On OS X, signal.h does not define the following values:
    
      - SIGSTKFLT
      - SIGCLD
      - SIGPOLL
      - SIGPWR
    
    These are now protected by the preprocessor.
    ---
     applications/rasql/rasql_signal.cc |   20 +++++++++++++++-----
     1 files changed, 15 insertions(+), 5 deletions(-)
    
    diff --git a/applications/rasql/rasql_signal.cc b/applications/rasql/rasql_signal.cc
    index b36f0cb..b7b68f4 100644
    a b signalHandler(int sig)  
    117117                        break;
    118118#ifndef SOLARIS
    119119#ifndef DECALPHA
     120#ifndef __APPLE__
    120121                case SIGSTKFLT:
    121122                        cout << "Stack fault.";
    122123                        break;
    123124#endif
    124125#endif
    125                 case SIGCLD:
    126                         cout << "SIGCHLD (System V) or child status has changed (POSIX).";
    127                         break;
     126#endif
    128127                case SIGCONT:
    129128                        cout << "Continue (POSIX).";
    130129                        break;
    signalHandler(int sig)  
    158157                case SIGWINCH:
    159158                        cout << "Window size change (4.3 BSD, Sun). Continuing operation.";
    160159                        break;
     160#ifndef __APPLE__
     161                case SIGCLD:
     162                        cout << "SIGCHLD (System V) or child status has changed (POSIX).";
     163                        break;
    161164                case SIGPOLL:
    162165                        cout << "Pollable event occurred (System V) or I/O now possible (4.2 BSD).";
    163166                        break;
    164167                case SIGPWR:
    165168                        cout << "Power failure restart (System V).";
    166169                        break;
     170#endif
    167171                case SIGSYS:
    168172                        cout << "Bad system call.";
    169173                        break;
    installSignalHandlers()  
    213217        signal(SIGTERM, signalHandler);
    214218#ifndef SOLARIS
    215219#ifndef DECALPHA
     220#ifndef __APPLE__
    216221        signal(SIGSTKFLT, signalHandler);
    217222#endif
    218223#endif
    219         signal(SIGCLD, signalHandler);
     224#endif
    220225        signal(SIGCHLD, signalHandler);
    221226        signal(SIGCONT, signalHandler);
    222227        signal(SIGSTOP, signalHandler);
    installSignalHandlers()  
    229234        signal(SIGVTALRM, signalHandler);
    230235        signal(SIGPROF, signalHandler);
    231236        signal(SIGWINCH, signalHandler);
     237#ifndef __APPLE__
     238        signal(SIGCLD, signalHandler);
    232239        signal(SIGPOLL, signalHandler);
    233         signal(SIGIO, signalHandler);
    234240        signal(SIGPWR, signalHandler);
     241#endif
     242        signal(SIGIO, signalHandler);
    235243        signal(SIGSYS, signalHandler);
    236244#if !defined SOLARIS
    237245#if !defined DECALPHA
     246#ifndef __APPLE__
    238247        signal(SIGUNUSED, signalHandler);
    239248#endif
    240249#endif
     250#endif
    241251        LEAVE( "installSignalHandlers" );
    242252}
    243253