summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2005-07-23 21:32:47 +0000
committerSimon Howard2005-07-23 21:32:47 +0000
commitbc24e169e52c28d7346787fc8cf1c2238dc2f7f3 (patch)
tree5f32c9bd6bb5bbb8aef21afd4786e51020c96cd5
parent6af18ee0fbbde60e78d86baac9a3248b5bb17e6b (diff)
downloadchocolate-doom-bc24e169e52c28d7346787fc8cf1c2238dc2f7f3.tar.gz
chocolate-doom-bc24e169e52c28d7346787fc8cf1c2238dc2f7f3.tar.bz2
chocolate-doom-bc24e169e52c28d7346787fc8cf1c2238dc2f7f3.zip
Add missing errno.h, fix crash on startup when no IWAD present
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 23
-rw-r--r--src/i_sound.c8
-rw-r--r--src/i_video.c10
2 files changed, 13 insertions, 5 deletions
diff --git a/src/i_sound.c b/src/i_sound.c
index 5812941d..82019c0d 100644
--- a/src/i_sound.c
+++ b/src/i_sound.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: i_sound.c 19 2005-07-23 19:17:11Z fraggle $
+// $Id: i_sound.c 23 2005-07-23 21:32:47Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.5 2005/07/23 21:32:47 fraggle
+// Add missing errno.h, fix crash on startup when no IWAD present
+//
// Revision 1.4 2005/07/23 19:17:11 fraggle
// Use ANSI-standard limit constants. Remove LINUX define.
//
@@ -41,11 +44,12 @@
//-----------------------------------------------------------------------------
static const char
-rcsid[] = "$Id: i_sound.c 19 2005-07-23 19:17:11Z fraggle $";
+rcsid[] = "$Id: i_sound.c 23 2005-07-23 21:32:47Z fraggle $";
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
+#include <errno.h>
#include <math.h>
diff --git a/src/i_video.c b/src/i_video.c
index b718e4d8..29eac891 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: i_video.c 19 2005-07-23 19:17:11Z fraggle $
+// $Id: i_video.c 23 2005-07-23 21:32:47Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.5 2005/07/23 21:32:47 fraggle
+// Add missing errno.h, fix crash on startup when no IWAD present
+//
// Revision 1.4 2005/07/23 19:17:11 fraggle
// Use ANSI-standard limit constants. Remove LINUX define.
//
@@ -41,10 +44,11 @@
//-----------------------------------------------------------------------------
static const char
-rcsid[] = "$Id: i_video.c 19 2005-07-23 19:17:11Z fraggle $";
+rcsid[] = "$Id: i_video.c 23 2005-07-23 21:32:47Z fraggle $";
#include <stdlib.h>
#include <unistd.h>
+#include <errno.h>
#include <sys/ipc.h>
#include <sys/shm.h>
@@ -177,7 +181,7 @@ int xlatekey(void)
void I_ShutdownGraphics(void)
{
// Detach from X server
- if (!XShmDetach(X_display, &X_shminfo))
+ if (X_display && !XShmDetach(X_display, &X_shminfo))
I_Error("XShmDetach() failed in I_ShutdownGraphics()");
// Release shared memory.