output: verify stream status when closing files

Includes also closing stdout and stderr at the end of execution.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2012-03-22 21:35:25 +01:00
parent 97e5b59b78
commit 3ef5d6c07f
4 changed files with 39 additions and 4 deletions

View file

@ -39,6 +39,7 @@
#include <config.h>
#include <arpa/inet.h>
#include <stddef.h>
#include <stdio.h>
/* Feature test switches */
#define _POSIX_SOURCE 1
@ -167,6 +168,8 @@ void *safe_malloc(const size_t size)
void *safe_realloc(void *__restrict ptr, const size_t size);
char *safe_strdup(const char *__restrict str) __attribute__ ((nonnull(1)));
int xstrstr(char *__restrict a, char *__restrict b, int len);
int close_stream(FILE * stream);
void close_stdout(void);
void print_version(void) __attribute__ ((noreturn));
void usage(int status) __attribute__ ((noreturn));
/* qsort required functions... */