Add a signal handler to the client

This commit is contained in:
Yamagi Burmeister 2011-10-10 07:51:16 +00:00
parent 2f095ec682
commit 60a2ca3eb9
5 changed files with 12 additions and 29 deletions

27
LICENSE
View file

@ -4,7 +4,6 @@ copys for each license:
- Quake II: GPLv2 - Quake II: GPLv2
- Info-ZIP (unzip): Info-ZIP License - Info-ZIP (unzip): Info-ZIP License
- libexecinfo: New BSD License
Parts of other Quake II Clients were included into the source. They Parts of other Quake II Clients were included into the source. They
covered by the same GPLv2 license as Quake II itself: covered by the same GPLv2 license as Quake II itself:
@ -431,29 +430,3 @@ freely, subject to the above disclaimer and the following restrictions:
=============================================================================== ===============================================================================
Copyright (c) 2003 Maxim Sobolev <sobomax@FreeBSD.org>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
===============================================================================

View file

@ -297,6 +297,7 @@ CLIENT_OBJS_ := \
src/unix/hunk.o \ src/unix/hunk.o \
src/unix/misc.o \ src/unix/misc.o \
src/unix/network.o \ src/unix/network.o \
src/unix/signalhandler.o \
src/unix/system.o \ src/unix/system.o \
src/unix/vid.o src/unix/vid.o
@ -342,6 +343,7 @@ SERVER_OBJS_ := \
src/unix/hunk.o \ src/unix/hunk.o \
src/unix/misc.o \ src/unix/misc.o \
src/unix/network.o \ src/unix/network.o \
src/unix/signalhandler.o \
src/unix/system.o src/unix/system.o
# ---------- # ----------

View file

@ -39,6 +39,8 @@
#define BUILDSTRING "Linux" #define BUILDSTRING "Linux"
#elif defined __FreeBSD__ #elif defined __FreeBSD__
#define BUILDSTRING "FreeBSD" #define BUILDSTRING "FreeBSD"
#else
#define BUILDSTRING "Unknown"
#endif #endif
#ifdef __i386__ #ifdef __i386__

View file

@ -41,5 +41,7 @@ typedef struct in_state
int *in_speed_state; int *in_speed_state;
} in_state_t; } in_state_t;
void registerHandler(void);
#endif #endif

View file

@ -31,6 +31,7 @@
#include <unistd.h> #include <unistd.h>
#include "../common/header/common.h" #include "../common/header/common.h"
#include "header/unix.h"
cvar_t *nostdout; cvar_t *nostdout;
uid_t saved_euid; uid_t saved_euid;
@ -54,6 +55,9 @@ main ( int argc, char **argv )
{ {
int time, oldtime, newtime; int time, oldtime, newtime;
/* register signal handler */
registerHandler();
/* go back to real user for config loads */ /* go back to real user for config loads */
saved_euid = geteuid(); saved_euid = geteuid();
seteuid( getuid() ); seteuid( getuid() );