#define STRTOXX_EXIT_CODE 4 /* strtoxx_or_err() */
#include "strutils.h"
+#include "closestream.h"
const char *progname = "blkid";
uintmax_t offset = 0, size = 0;
show[0] = NULL;
+ atexit(close_stdout);
while ((c = getopt (argc, argv, "c:df:ghilL:n:ko:O:ps:S:t:u:U:w:v")) != EOF)
switch (c) {
#include <errno.h>
#include "c.h"
+#include "closestream.h"
#include "nls.h"
#include "mbsalign.h"
#include "strutils.h"
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
#if defined(HAVE_LIBNCURSES) || defined(HAVE_LIBNCURSESW) || defined(HAVE_LIBTERMCAP)
if ((term = getenv("TERM"))) {
#include <stdio.h>
#include "nls.h"
+#include "closestream.h"
#include "c.h"
#ifndef __GNUC__
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
srandom(time(NULL));
/* do args here */
#include <blkid.h>
#include "nls.h"
+#include "closestream.h"
#include "c.h"
static void __attribute__((__noreturn__)) usage(int rc)
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
if (argc != 2)
/* we return '2' for backward compatibility
#include "pathnames.h"
#include "nls.h"
+#include "closestream.h"
#include "c.h"
#include "tt.h"
#include "strutils.h"
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
/* default output format */
tt_flags |= TT_FL_TREE;
#include "c.h"
#include "kill.h"
#include "nls.h"
+#include "closestream.h"
#include "strutils.h"
struct signv {
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
numsig = SIGTERM;
do_pid = (! strcmp (progname, "pid")); /* Yecch */
#include <getopt.h>
#include "c.h"
+#include "closestream.h"
#include "nls.h"
#include "strutils.h"
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
tag = NULL;
pri = LOG_NOTICE;
#include "nls.h"
#include "xalloc.h"
#include "pathnames.h"
+#include "closestream.h"
#define EQUAL 0
#define GREATER 1
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
setlocale(LC_ALL, "");
#include "strutils.h"
#include "at.h"
#include "sysfs.h"
+#include "closestream.h"
/* column IDs */
enum {
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
lsblk = &_ls;
memset(lsblk, 0, sizeof(*lsblk));
#include "at.h"
#include "strutils.h"
#include "c.h"
+#include "closestream.h"
/* column IDs */
enum {
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
while ((c = getopt_long(argc, argv,
"p:o:nruhV", long_opts, NULL)) != -1) {
#include "c.h"
#include "md5.h"
#include "nls.h"
+#include "closestream.h"
+
#include <fcntl.h>
#include <getopt.h>
#include <stddef.h>
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
while ((c =
getopt_long(argc, argv, "f:vVh", longopts, NULL)) != -1)
printf("%02x", digest[i]);
putchar('\n');
- /*
- * The following is important for cases like disk full,
- * so shell scripts can bomb out properly rather than
- * think they succeeded.
- */
- if (fflush(stdout) < 0 || fclose(stdout) < 0)
- return EXIT_FAILURE;
-
return EXIT_SUCCESS;
}
#include "nls.h"
#include "widechar.h"
#include "strutils.h"
+#include "closestream.h"
#ifndef MAXSYMLINKS
#define MAXSYMLINKS 256
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
while ((c = getopt_long(argc, argv, "hVlmnovx", longopts, NULL)) != -1) {
switch(c) {
#include "nls.h"
#include "xalloc.h"
#include "c.h"
+#include "closestream.h"
static int do_rename(char *from, char *to, char *s, int verbose)
{
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
while ((c = getopt_long(argc, argv, "vVh", longopts, NULL)) != -1)
switch (c) {
#include "uuidd.h"
#include "writeall.h"
+#include "closestream.h"
#include "nls.h"
#ifdef __GNUC__
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
while ((c =
getopt_long(argc, argv, "p:s:T:krtn:dqVh", longopts,
#include "uuid.h"
#include "nls.h"
#include "c.h"
+#include "closestream.h"
#define DO_TYPE_TIME 1
#define DO_TYPE_RANDOM 2
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
while ((c = getopt_long(argc, argv, "rtVh", longopts, NULL)) != -1)
switch (c) {
#include "xalloc.h"
#include "nls.h"
#include "c.h"
+#include "closestream.h"
static char *bindirs[] = {
"/bin",
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
argc--, argv++;
if (argc == 0)
#include "writeall.h"
#include "match.h"
#include "c.h"
+#include "closestream.h"
struct wipe_desc {
loff_t offset; /* magic string offset */
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
while ((c = getopt_long(argc, argv, "ahno:pqt:V", longopts, NULL)) != -1) {
switch(c) {