temp-file: New functions for creating temporary files honoring $TMPDIR. - pspp.git - GNU PSPP

index : pspp.git
GNU PSPP
summary refs log tree commit diff
path: root/src/libpspp/ext-array.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@cs.stanford.edu>2010年07月29日 22:08:33 -0700
committerBen Pfaff <blp@cs.stanford.edu>2010年07月29日 22:08:33 -0700
commite99991940478d76062c4ab8e44a5747354e33259 (patch)
tree0ebcf81bfbaf891f3c644cd4324c8f7a875bc8a8 /src/libpspp/ext-array.c
parent1d57a8b4c556e227cd562dcfa56c8cbce79f73a8 (diff)
downloadpspp-e99991940478d76062c4ab8e44a5747354e33259.tar.gz
temp-file: New functions for creating temporary files honoring $TMPDIR.
The tmpfile() function is useful, but it doesn't necessarily honor the $TMPDIR environment variable. Some of our users find that a problem, so this commit replaces tmpfile() usage by a new pair of functions create_temp_file() and close_temp_file() that do honor $TMPDIR. Bug #30530.
Diffstat (limited to 'src/libpspp/ext-array.c')
-rw-r--r--src/libpspp/ext-array.c 13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/libpspp/ext-array.c b/src/libpspp/ext-array.c
index df3b589fe..b1eded3a3 100644
--- a/src/libpspp/ext-array.c
+++ b/src/libpspp/ext-array.c
@@ -19,17 +19,18 @@
#include <config.h>
-#include <libpspp/ext-array.h>
+#include "libpspp/ext-array.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
-#include <libpspp/assertion.h>
-#include <libpspp/cast.h>
+#include "libpspp/assertion.h"
+#include "libpspp/cast.h"
+#include "libpspp/temp-file.h"
-#include "error.h"
-#include "xalloc.h"
+#include "gl/error.h"
+#include "gl/xalloc.h"
#include "gettext.h"
#define _(msgid) gettext (msgid)
@@ -50,7 +51,7 @@ struct ext_array *
ext_array_create (void)
{
struct ext_array *ea = xmalloc (sizeof *ea);
- ea->file = tmpfile ();
+ ea->file = create_temp_file ();
if (ea->file == NULL)
error (0, errno, _("failed to create temporary file"));
ea->position = 0;
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月21日 01:32:07 +0000

AltStyle によって変換されたページ (->オリジナル) /