X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fcase-source.c;h=542f3008f8f5f234538694bd59d2f39a04514d1e;hb=93b4335785430ab6de290b7978e2d506106a8ba5;hp=f8b73f3872159be8bb56febcdf3228628a05bbd4;hpb=c708736bdd0fea4b79f3ee4a10e00c3abb95d9e3;p=pspp-builds.git diff --git a/src/data/case-source.c b/src/data/case-source.c index f8b73f38..542f3008 100644 --- a/src/data/case-source.c +++ b/src/data/case-source.c @@ -1,6 +1,5 @@ /* PSPP - computes sample statistics. Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc. - Written by Ben Pfaff . 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. */