aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile3
-rw-r--r--src/restricted-hdparm.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 439e087..535c818 100644
--- a/Makefile
+++ b/Makefile
@@ -11,6 +11,7 @@ INFODIR = $(DATADIR)/info
LICENSEDIR = $(DATADIR)/licenses
PY3_SHEBANG = "/usr/bin/env python3"
+HDPARM_PATH = /usr/sbin/hdparm
COMMAND = xpybar
PKGNAME = xpybar
@@ -78,7 +79,7 @@ bin/restricted-hdparm: obj/restricted-hdparm.o
$(CC) -std=c89 -Ofast $(WARN) -o $@ $^
obj/%.o: src/%.c
- $(CC) -std=c89 -Ofast $(WARN) -c -o $@ $<
+ $(CC) -std=c89 -Ofast $(WARN) -c -o $@ $< -D'HDPARM_PATH="$(HDPARM_PATH)"'
.PHONY: doc
doc: info pdf dvi ps
diff --git a/src/restricted-hdparm.c b/src/restricted-hdparm.c
index 67e1338..2b2e0f0 100644
--- a/src/restricted-hdparm.c
+++ b/src/restricted-hdparm.c
@@ -58,7 +58,7 @@ int main(int argc, char** argv)
else
return 1;
- execv("hdparm", argv);
+ execv(HDPARM_PATH, argv);
perror(*argv);
return 1;