mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-18 06:51:47 +00:00
exit cleanup. Sys_Error and Sys_Quit should be used whenever possible.
This commit is contained in:
parent
2887dd3950
commit
b455458629
6 changed files with 7 additions and 46 deletions
|
@ -55,10 +55,11 @@
|
|||
#include <sys/asoundlib.h>
|
||||
|
||||
#include "QF/console.h"
|
||||
#include "QF/cvar.h"
|
||||
#include "QF/plugin.h"
|
||||
#include "QF/qargs.h"
|
||||
#include "QF/sound.h"
|
||||
#include "QF/plugin.h"
|
||||
#include "QF/cvar.h"
|
||||
#include "QF/sys.h"
|
||||
|
||||
#ifndef MAP_FAILED
|
||||
# define MAP_FAILED ((void*)-1)
|
||||
|
@ -346,9 +347,7 @@ SNDDMA_Submit (void)
|
|||
case SND_PCM_STATUS_PREPARED:
|
||||
if ((rc = snd_pcm_channel_go (pcm_handle, SND_PCM_CHANNEL_PLAYBACK))
|
||||
< 0) {
|
||||
fprintf (stderr, "unable to start playback. %s\n",
|
||||
snd_strerror (rc));
|
||||
exit (1);
|
||||
Sys_Error ("unable to start playback. %s\n", snd_strerror (rc));
|
||||
}
|
||||
break;
|
||||
case SND_PCM_STATUS_RUNNING:
|
||||
|
@ -358,10 +357,8 @@ SNDDMA_Submit (void)
|
|||
(rc =
|
||||
snd_pcm_plugin_prepare (pcm_handle,
|
||||
SND_PCM_CHANNEL_PLAYBACK)) < 0) {
|
||||
fprintf (stderr,
|
||||
"underrun: playback channel prepare error. %s\n",
|
||||
snd_strerror (rc));
|
||||
exit (1);
|
||||
Sys_Error ("underrun: playback channel prepare error. %s\n",
|
||||
snd_strerror (rc));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -194,11 +194,6 @@ TragicDeath (int sig)
|
|||
#ifdef HAVE_UNISTD_H
|
||||
}
|
||||
#endif
|
||||
|
||||
// exit (sig);
|
||||
// XCloseDisplay(x_disp);
|
||||
// VID_Shutdown();
|
||||
// Sys_Error("This death brought to you by the number %d\n", signal_num);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -110,8 +110,6 @@ signal_handler (int sig)
|
|||
{
|
||||
printf ("Received signal %d, exiting...\n", sig);
|
||||
Sys_Quit ();
|
||||
abort ();
|
||||
exit (0);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -111,31 +111,6 @@ VID_Shutdown (void)
|
|||
X11_CloseDisplay ();
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
signal_handler (int sig)
|
||||
{
|
||||
printf ("Received signal %d, exiting...\n", sig);
|
||||
Sys_Quit ();
|
||||
exit (sig);
|
||||
}
|
||||
|
||||
static void
|
||||
InitSig (void)
|
||||
{
|
||||
signal (SIGHUP, signal_handler);
|
||||
signal (SIGINT, signal_handler);
|
||||
signal (SIGQUIT, signal_handler);
|
||||
signal (SIGILL, signal_handler);
|
||||
signal (SIGTRAP, signal_handler);
|
||||
signal (SIGIOT, signal_handler);
|
||||
signal (SIGBUS, signal_handler);
|
||||
/* signal (SIGFPE, signal_handler); */
|
||||
signal (SIGSEGV, signal_handler);
|
||||
signal (SIGTERM, signal_handler);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
GL_Init
|
||||
*/
|
||||
|
@ -221,9 +196,7 @@ VID_Init (unsigned char *palette)
|
|||
|
||||
x_visinfo = glXChooseVisual (x_disp, x_screen, attrib);
|
||||
if (!x_visinfo) {
|
||||
fprintf (stderr,
|
||||
"Error couldn't get an RGB, Double-buffered, Depth visual\n");
|
||||
exit (1);
|
||||
Sys_Error ("Error couldn't get an RGB, Double-buffered, Depth visual\n");
|
||||
}
|
||||
x_vis = x_visinfo->visual;
|
||||
|
||||
|
|
|
@ -114,7 +114,6 @@ signal_handler (int sig)
|
|||
{
|
||||
printf ("Received signal %d, exiting...\n", sig);
|
||||
Sys_Quit ();
|
||||
exit (sig);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -105,7 +105,6 @@ Sys_Error (const char *error, ...)
|
|||
|
||||
Host_Shutdown ();
|
||||
exit (1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue