From: Robert Pengelly Date: Mon, 13 Oct 2025 03:32:04 +0000 (+0100) Subject: Try getting TMPDIR first X-Git-Url: https://git.candlhat.org/?a=commitdiff_plain;h=HEAD;p=sar.git Try getting TMPDIR first --- diff --git a/lib.c b/lib.c index fa03cc4..af41105 100644 --- a/lib.c +++ b/lib.c @@ -273,9 +273,13 @@ void *xrealloc (void *__ptr, unsigned long __size) { #if defined (unix) || defined (__unix) || defined (__unix__) || defined (__APPLE__) FILE *get_temp_file (void) { - char *temp_path = "/tmp", *template; + char *temp_path, *template; int fd; + if (!(temp_path = getenv ("TMPDIR"))) { + temp_path = "/tmp"; + } + template = xmalloc (strlen (temp_path) + 1 + 10 + 1); sprintf (template, "%s/sarXXXXXX", temp_path);