diff src/audio/pulse/SDL_pulseaudio.c @ 4344:14f95e514408 SDL-1.2

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
author Sam Lantinga <slouken@libsdl.org>
date Fri, 16 Oct 2009 05:12:20 +0000
parents 5b99971a27b4
children f5d3f7fa071d
line wrap: on
line diff
--- 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) {