Get rid of our own int32 type in favor of the standard int32_t type.
[pspp] / src / data / any-writer.c
index 93d2817019c2c0afd1bdc0fb3d78b6babc542f7c..9ee8af917e03cbdfd03f49642409a725addd5ae0 100644 (file)
 #include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include "message.h"
+#include <libpspp/message.h>
 #include "file-handle-def.h"
 #include "filename.h"
 #include "por-file-writer.h"
 #include "sys-file-writer.h"
-#include "str.h"
+#include <libpspp/str.h>
 #include "scratch-writer.h"
 #include "xalloc.h"
 
@@ -189,21 +189,29 @@ any_writer_error (const struct any_writer *writer)
 bool
 any_writer_close (struct any_writer *writer) 
 {
+  bool ok;
+  
   if (writer == NULL)
     return true;
 
   switch (writer->type) 
     {
     case SYSTEM_FILE:
-      return sfm_close_writer (writer->private);
+      ok = sfm_close_writer (writer->private);
+      break;
 
     case PORTABLE_FILE:
-      return pfm_close_writer (writer->private);
+      ok = pfm_close_writer (writer->private);
+      break;
 
     case SCRATCH_FILE:
-      return scratch_writer_close (writer->private);
-
+      ok = scratch_writer_close (writer->private);
+      break;
+      
     default:
       abort ();
     }
+
+  free (writer);
+  return ok;
 }