Apply patches #5828, #5837, #5841, #5843.
[pspp-builds.git] / src / data / case-source.c
index f8b73f3872159be8bb56febcdf3228628a05bbd4..542f3008f8f5f234538694bd59d2f39a04514d1e 100644 (file)
@@ -1,6 +1,5 @@
 /* PSPP - computes sample statistics.
    Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc.
-   Written by Ben Pfaff <blp@gnu.org>.
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -37,17 +36,21 @@ create_case_source (const struct case_source_class *class,
   return source;
 }
 
-/* Destroys case source SOURCE.  It is the caller's responsible to
-   call the source's destroy function, if any. */
-void
+/* Destroys case source SOURCE.
+   Returns true if successful,
+   false if the source encountered an I/O error during
+   destruction or reading cases. */
+bool
 free_case_source (struct case_source *source) 
 {
+  bool ok = true;
   if (source != NULL) 
     {
       if (source->class->destroy != NULL)
-        source->class->destroy (source);
+        ok = source->class->destroy (source);
       free (source);
     }
+  return ok;
 }
 
 /* Returns true if CLASS is the class of SOURCE. */