X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flibpspp%2Fext-array.c;h=57ff8e4a7d6225e3b56c9b71c0760e6e9570f635;hb=2c043e1bf0d36ae7b3900bf3c2b98196f67d5b7d;hp=df3b589fe0c893dad1828c52e86b2542ce78f5b4;hpb=1d57a8b4c556e227cd562dcfa56c8cbce79f73a8;p=pspp diff --git a/src/libpspp/ext-array.c b/src/libpspp/ext-array.c index df3b589fe0..57ff8e4a7d 100644 --- a/src/libpspp/ext-array.c +++ b/src/libpspp/ext-array.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 2007, 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,17 +19,19 @@ #include -#include +#include "libpspp/ext-array.h" #include #include #include -#include -#include +#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/unlocked-io.h" +#include "gl/xalloc.h" #include "gettext.h" #define _(msgid) gettext (msgid) @@ -50,7 +52,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; @@ -67,7 +69,7 @@ ext_array_destroy (struct ext_array *ea) { ok = !ext_array_error (ea); if (ea->file != NULL) - fclose (ea->file); + close_temp_file (ea->file); free (ea); } return ok;