patch-pulse (from ahoka@NetBSD.org): SDL-1.2
authorSam Lantinga <slouken@libsdl.org>
Fri, 16 Oct 2009 05:12:20 +0000
branchSDL-1.2
changeset 4344 14f95e514408
parent 4343 d380e7a6265b
child 4345 b40d6e58a5e5
patch-pulse (from ahoka@NetBSD.org): Fix assertion triggered in pulsaudio by returning "unknown" instead of NULL pointer when guessing application name. - Use getprogname on NetBSD as it wont return NULL
src/audio/pulse/SDL_pulseaudio.c
--- a/src/audio/pulse/SDL_pulseaudio.c	Fri Oct 16 05:06:17 2009 +0000
+++ b/src/audio/pulse/SDL_pulseaudio.c	Fri Oct 16 05:12:20 2009 +0000
@@ -346,8 +346,8 @@
 /* Try to get the name of the program */
 static char *get_progname(void)
 {
+#ifdef __LINUX__
 	char *progname = NULL;
-#ifdef __LINUX__
 	FILE *fp;
 	static char temp[BUFSIZ];
 
@@ -364,8 +364,12 @@
 		}
 		fclose(fp);
 	}
+	return(progname);
+#elif defined(__NetBSD__)
+	return getprogname();
+#else
+	return("unknown");
 #endif
-	return(progname);
 }
 
 static void stream_drain_complete(pa_stream *s, int success, void *userdata) {