iUse a random temporary directory instead of a fixed one - 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 f2b48c669ee5b69e3b46f64979739d15f41338c2 /scm/sacc/commit/f2b48c669ee5b69e3b46f64979739d15f41338c2.gph bitreich.org 70 1parent 49292644fd4a8c983928738fe36ac9daaebc755d /scm/sacc/commit/49292644fd4a8c983928738fe36ac9daaebc755d.gph bitreich.org 70 hAuthor: Quentin Rameau URL:mailto:quinq@fifth.space bitreich.org 70 iDate: Wed, 19 Feb 2020 21:36:37 +0100 Err bitreich.org 70 i Err bitreich.org 70 iUse a random temporary directory instead of a fixed one Err bitreich.org 70 i Err bitreich.org 70 iThanks to the persons who asked for this. Err bitreich.org 70 i Err bitreich.org 70 iDiffstat: Err bitreich.org 70 i M config.def.h | 4 ++-- Err bitreich.org 70 i M sacc.c | 2 +- Err bitreich.org 70 i Err bitreich.org 70 i2 files changed, 3 insertions(+), 3 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,5 +23,5 @@ 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-/* temporary directory */ Err bitreich.org 70 i-static char *tmpdir = "/tmp/sacc"; 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 1diff --git a/sacc.c b/sacc.c /scm/sacc/file/sacc.c.gph bitreich.org 70 i@@ -976,7 +976,7 @@ setup(void) Err bitreich.org 70 i sigaction(SIGHUP, &sa, NULL); Err bitreich.org 70 i sigaction(SIGTERM, &sa, NULL); Err bitreich.org 70 i Err bitreich.org 70 i- if (mkdir(tmpdir, S_IRWXU) < 0 && errno != EEXIST) Err bitreich.org 70 i+ if (!mkdtemp(tmpdir)) Err bitreich.org 70 i die("mkdir: %s: %s", tmpdir, strerror(errno)); Err bitreich.org 70 i if(interactive = isatty(1)) { Err bitreich.org 70 i uisetup(); Err bitreich.org 70 .