code format
This commit is contained in:
@@ -1,24 +1,25 @@
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Signals
|
||||
Ivan Pelipenko peri4ko@yandex.ru
|
||||
PIP - Platform Independent Primitives
|
||||
Signals
|
||||
Ivan Pelipenko peri4ko@yandex.ru
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "piincludes.h"
|
||||
#include "pisignals.h"
|
||||
|
||||
#include "piincludes.h"
|
||||
#ifdef BLACKBERRY
|
||||
# include <signal.h>
|
||||
#else
|
||||
@@ -39,10 +40,10 @@ void PISignals::grabSignals(PIFlags<PISignals::Signal> signals_) {
|
||||
if (signals_[PISignals::FPE]) signal(signalCode(PISignals::FPE), PISignals::signal_event);
|
||||
if (signals_[PISignals::SegFault]) signal(signalCode(PISignals::SegFault), PISignals::signal_event);
|
||||
if (signals_[PISignals::Termination]) signal(signalCode(PISignals::Termination), PISignals::signal_event);
|
||||
# ifndef CC_VC
|
||||
#ifndef CC_VC
|
||||
if (signals_[PISignals::UserDefined1]) signal(signalCode(PISignals::UserDefined1), PISignals::signal_event);
|
||||
if (signals_[PISignals::UserDefined2]) signal(signalCode(PISignals::UserDefined2), PISignals::signal_event);
|
||||
# endif
|
||||
#endif
|
||||
#ifndef WINDOWS
|
||||
if (signals_[PISignals::Hangup]) signal(signalCode(PISignals::Hangup), PISignals::signal_event);
|
||||
if (signals_[PISignals::Quit]) signal(signalCode(PISignals::Quit), PISignals::signal_event);
|
||||
@@ -72,10 +73,10 @@ int PISignals::signalCode(PISignals::Signal signal) {
|
||||
case PISignals::FPE: return SIGFPE;
|
||||
case PISignals::SegFault: return SIGSEGV;
|
||||
case PISignals::Termination: return SIGTERM;
|
||||
# ifndef CC_VC
|
||||
#ifndef CC_VC
|
||||
case PISignals::UserDefined1: return SIGUSR1;
|
||||
case PISignals::UserDefined2: return SIGUSR2;
|
||||
# endif
|
||||
#endif
|
||||
#ifndef WINDOWS
|
||||
case PISignals::Hangup: return SIGHUP;
|
||||
case PISignals::Quit: return SIGQUIT;
|
||||
@@ -87,7 +88,7 @@ int PISignals::signalCode(PISignals::Signal signal) {
|
||||
case PISignals::StopProcess: return SIGSTOP;
|
||||
case PISignals::StopTTY: return SIGTSTP;
|
||||
case PISignals::StopTTYInput: return SIGTTIN;
|
||||
case PISignals::StopTTYOutput:return SIGTTOU;
|
||||
case PISignals::StopTTYOutput: return SIGTTOU;
|
||||
#endif
|
||||
default:;
|
||||
}
|
||||
@@ -103,10 +104,10 @@ PISignals::Signal PISignals::signalFromCode(int signal) {
|
||||
case SIGFPE: return PISignals::FPE;
|
||||
case SIGSEGV: return PISignals::SegFault;
|
||||
case SIGTERM: return PISignals::Termination;
|
||||
# ifndef CC_VC
|
||||
#ifndef CC_VC
|
||||
case SIGUSR1: return PISignals::UserDefined1;
|
||||
case SIGUSR2: return PISignals::UserDefined2;
|
||||
# endif
|
||||
#endif
|
||||
#ifndef WINDOWS
|
||||
case SIGHUP: return PISignals::Hangup;
|
||||
case SIGQUIT: return PISignals::Quit;
|
||||
|
||||
Reference in New Issue
Block a user