| Date: Sat, 2 Oct 2021 15:19:30 -0400
Add modal plumber
With this option activated, sacc will wait for the plumber to return
before continuing its execution.
Diffstat:
M config.def.h | 3 +++
M sacc.c | 5 +++++
2 files changed, 8 insertions(+), 0 deletions(-)
--- |
| t@@ -23,6 +23,9 @@
/* default plumber */
static char *plumber = "xdg-open";
+/* modal plumber will make sacc wait for the plumber to return */
+static int modalplumber = 0;
+
/* temporary directory template (must end with six 'X' characters) */
static char tmpdir[] = "/tmp/sacc-XXXXXX";
|
| t@@ -651,6 +651,11 @@ plumb(char *url)
dup2(devnullfd, 2);
if (execlp(plumber, plumber, url, NULL) == -1)
_exit(1);
+ default:
+ if (modalplumber) {
+ while (waitpid(-1, NULL, 0) != -1)
+ ;
+ }
}
diag("Plumbed \"%s\"", url); |