exit cleanup. Sys_Error and Sys_Quit should be used whenever possible.

This commit is contained in:
Bill Currie 2001-08-02 17:16:12 +00:00
parent 2887dd3950
commit b455458629
6 changed files with 7 additions and 46 deletions

View file

@ -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:

View file

@ -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

View file

@ -110,8 +110,6 @@ signal_handler (int sig)
{
printf ("Received signal %d, exiting...\n", sig);
Sys_Quit ();
abort ();
exit (0);
}
void

View file

@ -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;

View file

@ -114,7 +114,6 @@ signal_handler (int sig)
{
printf ("Received signal %d, exiting...\n", sig);
Sys_Quit ();
exit (sig);
}
static void

View file

@ -105,7 +105,6 @@ Sys_Error (const char *error, ...)
Host_Shutdown ();
exit (1);
}