]> git.alsa-project.org Git - alsa-oss.git/commitdiff
Optimize aoss wrapper
authorTakashi Iwai <tiwai@suse.de>
Thu, 27 Oct 2005 18:34:18 +0000 (18:34 +0000)
committerTakashi Iwai <tiwai@suse.de>
Thu, 27 Oct 2005 18:34:18 +0000 (18:34 +0000)
- Don't set LD_PRELOAD if no ALSA driver exists.
- Inheret the previous LD_PRELOAD setting.

alsa/aoss.in

index ff707c19469e3e8d8c0debf4ab7333c2fc73ec1a..c551431c3d90a2b61ee66872576d37f5da4c33de 100644 (file)
@@ -4,6 +4,11 @@
 # Usage:
 #      aoss <command> <command options and arguments>
 
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-LD_PRELOAD=${exec_prefix}/\$LIB/libaoss.so exec "$@"
+if [ -d /proc/asound ]; then
+  prefix=@prefix@
+  exec_prefix=@exec_prefix@
+  LD_PRELOAD=${exec_prefix}/\$LIB/libaoss.so${LD_PRELOAD:+:$LD_PRELOAD} exec "$@"
+else
+  exec "$@"
+fi
+exit 1