iAdd modal plumber - sacc - sacc(omys), simple console gopher client Err bitreich.org 70 hgit clone git://bitreich.org/sacc/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/sacc/ URL:git://bitreich.org/sacc/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/sacc/ bitreich.org 70 1Log /scm/sacc/log.gph bitreich.org 70 1Files /scm/sacc/files.gph bitreich.org 70 1Refs /scm/sacc/refs.gph bitreich.org 70 1Tags /scm/sacc/tag bitreich.org 70 1LICENSE /scm/sacc/file/LICENSE.gph bitreich.org 70 i--- Err bitreich.org 70 1commit 12b8b8a338d1791ce2d200f7cad99c9f0b5804d1 /scm/sacc/commit/12b8b8a338d1791ce2d200f7cad99c9f0b5804d1.gph bitreich.org 70 1parent 7e0793d8395184b5b21ecdd0b13bccb524d1e414 /scm/sacc/commit/7e0793d8395184b5b21ecdd0b13bccb524d1e414.gph bitreich.org 70 hAuthor: escapeinsert URL:mailto:ben@0x1bi.net bitreich.org 70 iDate: Sat, 2 Oct 2021 15:19:30 -0400 Err bitreich.org 70 i Err bitreich.org 70 iAdd modal plumber Err bitreich.org 70 i Err bitreich.org 70 iWith this option activated, sacc will wait for the plumber to return Err bitreich.org 70 ibefore continuing its execution. Err bitreich.org 70 i Err bitreich.org 70 iDiffstat: Err bitreich.org 70 i M config.def.h | 3 +++ Err bitreich.org 70 i M sacc.c | 5 +++++ Err bitreich.org 70 i Err bitreich.org 70 i2 files changed, 8 insertions(+), 0 deletions(-) Err bitreich.org 70 i--- Err bitreich.org 70 1diff --git a/config.def.h b/config.def.h /scm/sacc/file/config.def.h.gph bitreich.org 70 i@@ -23,6 +23,9 @@ Err bitreich.org 70 i /* default plumber */ Err bitreich.org 70 i static char *plumber = "xdg-open"; Err bitreich.org 70 i Err bitreich.org 70 i+/* modal plumber will make sacc wait for the plumber to return */ Err bitreich.org 70 i+static int modalplumber = 0; Err bitreich.org 70 i+ Err bitreich.org 70 i /* temporary directory template (must end with six 'X' characters) */ Err bitreich.org 70 i static char tmpdir[] = "/tmp/sacc-XXXXXX"; Err bitreich.org 70 i Err bitreich.org 70 1diff --git a/sacc.c b/sacc.c /scm/sacc/file/sacc.c.gph bitreich.org 70 i@@ -651,6 +651,11 @@ plumb(char *url) Err bitreich.org 70 i dup2(devnullfd, 2); Err bitreich.org 70 i if (execlp(plumber, plumber, url, NULL) == -1) Err bitreich.org 70 i _exit(1); Err bitreich.org 70 i+ default: Err bitreich.org 70 i+ if (modalplumber) { Err bitreich.org 70 i+ while (waitpid(-1, NULL, 0) != -1) Err bitreich.org 70 i+ ; Err bitreich.org 70 i+ } Err bitreich.org 70 i } Err bitreich.org 70 i Err bitreich.org 70 i diag("Plumbed \"%s\"", url); Err bitreich.org 70 .