* [PATCH] verify SDL_Init
@ 2007-09-24 14:58 Robert Millan
0 siblings, 0 replies; only message in thread
From: Robert Millan @ 2007-09-24 14:58 UTC (permalink / raw)
To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
[-- Attachment #1: Type: text/plain, Size: 277 bytes --]
Skipping SDL_Init failure leads to segfault in further SDL calls. This
patch makes the situation easier to understand to the user.
--
Robert Millan
<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call, if you are unable to speak?
(as seen on /.)
[-- Attachment #2: renouveau_init.diff --]
[-- Type: text/x-diff, Size: 589 bytes --]
Index: re.c
===================================================================
RCS file: /cvsroot/nouveau/renouveau/re.c,v
retrieving revision 1.125
diff -u -r1.125 re.c
--- re.c 28 Aug 2007 11:41:31 -0000 1.125
+++ re.c 24 Sep 2007 13:42:21 -0000
@@ -53,7 +53,10 @@
*/
void setup_SDL(int opengl)
{
- SDL_Init(SDL_INIT_VIDEO);
+ if (SDL_Init(SDL_INIT_VIDEO)) {
+ fprintf (stderr, "Failed to initialise SDL video output.\n");
+ exit (1);
+ }
if (opengl) {
//SDL_GL_SetAttribute(SDL_GL_STEREO,1);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER,0);
[-- Attachment #3: Type: text/plain, Size: 181 bytes --]
_______________________________________________
Nouveau mailing list
Nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
http://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-09-24 14:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-24 14:58 [PATCH] verify SDL_Init Robert Millan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.