Remove hard-coded paths to system tools available in $PATH

This patch implemements a new feature of libite v1.9.1, whichp(), which
instead of fexist() that requires an absolute path, searches $PATH.

For reference, see issue #69 and PRs #70 and #72.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2017-07-03 13:13:55 +02:00
1 parent 30822f0d68
commit 9c6e046d93
5 files changed
+23 -24

No files matched your search

+3 -3
View File
@@ -26,11 +26,11 @@
#include "helpers.h"
#include "plugin.h"
#define ALSACTL "/usr/sbin/alsactl"
#define ALSACTL "alsactl"
static void save(void *arg)
{
if (fexist(ALSACTL)) {
if (whichp(ALSACTL)) {
_d("Saving sound settings ...");
run_interactive(ALSACTL " -g store", "Saving sound settings");
}
@@ -38,7 +38,7 @@ static void save(void *arg)
static void restore(void *arg)
{
if (fexist(ALSACTL)) {
if (whichp(ALSACTL)) {
_d("Restoring sound settings ...");
run_interactive(ALSACTL " -g restore", "Restoring sound settings");
}