Mercurial > sdl-ios-xcode
comparison 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 |
comparison
equal
deleted
inserted
replaced
4343:d380e7a6265b | 4344:14f95e514408 |
---|---|
344 } | 344 } |
345 | 345 |
346 /* Try to get the name of the program */ | 346 /* Try to get the name of the program */ |
347 static char *get_progname(void) | 347 static char *get_progname(void) |
348 { | 348 { |
349 #ifdef __LINUX__ | |
349 char *progname = NULL; | 350 char *progname = NULL; |
350 #ifdef __LINUX__ | |
351 FILE *fp; | 351 FILE *fp; |
352 static char temp[BUFSIZ]; | 352 static char temp[BUFSIZ]; |
353 | 353 |
354 SDL_snprintf(temp, SDL_arraysize(temp), "/proc/%d/cmdline", getpid()); | 354 SDL_snprintf(temp, SDL_arraysize(temp), "/proc/%d/cmdline", getpid()); |
355 fp = fopen(temp, "r"); | 355 fp = fopen(temp, "r"); |
362 progname = progname+1; | 362 progname = progname+1; |
363 } | 363 } |
364 } | 364 } |
365 fclose(fp); | 365 fclose(fp); |
366 } | 366 } |
367 return(progname); | |
368 #elif defined(__NetBSD__) | |
369 return getprogname(); | |
370 #else | |
371 return("unknown"); | |
367 #endif | 372 #endif |
368 return(progname); | |
369 } | 373 } |
370 | 374 |
371 static void stream_drain_complete(pa_stream *s, int success, void *userdata) { | 375 static void stream_drain_complete(pa_stream *s, int success, void *userdata) { |
372 } | 376 } |
373 | 377 |