projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix typo which cause the binary not to depend upon any libraries
[pspp]
/
src
/
data
/
any-writer.c
diff --git
a/src/data/any-writer.c
b/src/data/any-writer.c
index 93d2817019c2c0afd1bdc0fb3d78b6babc542f7c..de44df4682788b8bc4d380ccb181b8a2221be204 100644
(file)
--- a/
src/data/any-writer.c
+++ b/
src/data/any-writer.c
@@
-1,6
+1,5
@@
/* PSPP - computes sample statistics.
Copyright (C) 2006 Free Software Foundation, Inc.
/* PSPP - computes sample statistics.
Copyright (C) 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
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@
-24,12
+23,13
@@
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
-#include "message.h"
+#include <libpspp/assertion.h>
+#include <libpspp/message.h>
#include "file-handle-def.h"
#include "file-handle-def.h"
-#include "filename.h"
+#include "file
-
name.h"
#include "por-file-writer.h"
#include "sys-file-writer.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"
#include "scratch-writer.h"
#include "xalloc.h"
@@
-62,7
+62,7
@@
any_writer_open (struct file_handle *handle, struct dictionary *dict)
struct any_writer *writer;
char *extension;
struct any_writer *writer;
char *extension;
- extension = fn_extension (fh_get_filename (handle));
+ extension = fn_extension (fh_get_file
_
name (handle));
str_lowercase (extension);
if (!strcmp (extension, ".por"))
str_lowercase (extension);
if (!strcmp (extension, ".por"))
@@
-85,7
+85,7
@@
any_writer_open (struct file_handle *handle, struct dictionary *dict)
dict));
}
dict));
}
-
abort
();
+
NOT_REACHED
();
}
/* If PRIVATE is non-null, creates and returns a new any_writer,
}
/* If PRIVATE is non-null, creates and returns a new any_writer,
@@
-162,7
+162,7
@@
any_writer_write (struct any_writer *writer, const struct ccase *c)
case SCRATCH_FILE:
return scratch_writer_write_case (writer->private, c);
}
case SCRATCH_FILE:
return scratch_writer_write_case (writer->private, c);
}
-
abort
();
+
NOT_REACHED
();
}
/* Returns true if an I/O error has occurred on WRITER, false
}
/* Returns true if an I/O error has occurred on WRITER, false
@@
-181,7
+181,7
@@
any_writer_error (const struct any_writer *writer)
case SCRATCH_FILE:
return scratch_writer_error (writer->private);
}
case SCRATCH_FILE:
return scratch_writer_error (writer->private);
}
-
abort
();
+
NOT_REACHED
();
}
/* Closes WRITER.
}
/* Closes WRITER.
@@
-189,21
+189,29
@@
any_writer_error (const struct any_writer *writer)
bool
any_writer_close (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:
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:
case PORTABLE_FILE:
- return pfm_close_writer (writer->private);
+ ok = pfm_close_writer (writer->private);
+ break;
case SCRATCH_FILE:
case SCRATCH_FILE:
- return scratch_writer_close (writer->private);
-
+ ok = scratch_writer_close (writer->private);
+ break;
+
default:
default:
-
abort
();
+
NOT_REACHED
();
}
}
+
+ free (writer);
+ return ok;
}
}