aboutsummaryrefslogtreecommitdiffstats
path: root/noice.c
diff options
context:
space:
mode:
authorsin <sin@2f30.org>2019-08-22 15:09:29 +0100
committersin <sin@2f30.org>2019-08-22 17:21:29 +0100
commit58edea240e40eeb006923f012a6bb792fb8ef8a7 (patch)
tree8c3a04522acecc24a2cba5dc66af97389f678b9e /noice.c
parent784551aa55ff996e103443d1bbe65684fd4d7463 (diff)
downloadnoice-58edea240e40eeb006923f012a6bb792fb8ef8a7.tar.gz
Fix spawn*() so it can report errors to the caller
If nopen is not in PATH, noice will briefly print a warning about it so the user knows. Also, add NOPENCMD define in noiceconf.def.h to specify the default plumber program.
Diffstat (limited to 'noice.c')
-rw-r--r--noice.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/noice.c b/noice.c
index b73f1ea..1b60370 100644
--- a/noice.c
+++ b/noice.c
@@ -650,8 +650,12 @@ nochange:
goto begin;
case S_IFREG:
exitcurses();
- spawnlp(path, "nopen", "nopen", newpath, (void *)0);
+ r = spawnlp(path, NOPENCMD, NOPENCMD, newpath, (void *)0);
initcurses();
+ if (r == -1) {
+ printmsg("failed to execute " NOPENCMD);
+ goto nochange;
+ }
continue;
default:
printmsg("Unsupported file");
Un proyecto texto-plano.xyz