Bug#747328: pacmd: returns success exit status 0 even when it fails
J G Miller
miller at yoyo.ORG
Wed May 7 14:46:47 UTC 2014
Package: pulseaudio-utils
Version: 2.0-6.1
Severity: normal
Tags: upstream
The pulseaudio utility program pacmd should return meaningful exit codes --
0 for success or 1[...N] when it fails to perform a specified action.
In its current state in Debian 7.5 (pacmd 2.0, compiled with libpulse 2.0.0,
linked with libpulse 2.0.0), it return 0 success, even when it fails.
Two examples of many --
-------------------------------------------------------------------------------------
echo ; pacmd load-module module-alsa-source
name="non-existent-imagainary-device" ;
status=${?} ; echo -e "\n\npacmd exit status was ${status}\n"
Welcome to PulseAudio! Use "help" for usage information.
>>> Module load failed.
>>>
pacmd exit status was 0
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
echo ; pacmd set-default-source "non-existent-imagainary-device" ;
status=${?} ;
echo -e "\n\npacmd exit status was ${status}\n"
Welcome to PulseAudio! Use "help" for usage information.
>>> Source non-existent-imagainary-device does not exist.
>>>
pacmd exit status was 0
-------------------------------------------------------------------------------------
Surely a fundamental requirement of a properly written program is that
it exits with an appropriate return value that can be dependend upon to
indicate whether or not an action succeeded?
-- System Information:
Debian Release: 7.5
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: armhf (armv7l)
Kernel: Linux 3.0.35.8-armhf.com (SMP w/4 CPU cores; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C)
Shell: /bin/sh linked to /bin/dash
Versions of packages pulseaudio-utils depends on:
ii libc6 2.13-38+deb7u1
ii libcap2 1:2.22-1.2
ii libice6 2:1.0.8-2
ii libpulse0 2.0-6.1
ii libsm6 2:1.2.1-2
ii libsndfile1 1.0.25-5
ii libx11-6 2:1.5.0-1+deb7u1
ii libx11-xcb1 2:1.5.0-1+deb7u1
ii libxcb1 1.8.1-2+deb7u1
ii libxtst6 2:1.2.1-1+deb7u1
pulseaudio-utils recommends no packages.
Versions of packages pulseaudio-utils suggests:
ii avahi-daemon 0.6.31-2
-- no debconf information
More information about the pkg-pulseaudio-devel
mailing list