#include <sys/utsname.h>
#include "c.h"
+#include "closestream.h"
#include "nls.h"
static void __attribute__ ((__noreturn__)) usage(FILE * out)
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
while ((ch = getopt_long(argc, argv, "Vh", longopts, NULL)) != -1)
switch (ch) {
#include "strutils.h"
#include "bitops.h"
#include "path.h"
+#include "closestream.h"
#define _PATH_SYS_CPU "/sys/devices/system/cpu"
#define _PATH_SYS_CPU_ONLINE _PATH_SYS_CPU "/online"
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
maxcpus = get_max_number_of_cpus();
if (maxcpus < 1)
#include "linux_reboot.h"
#include "nls.h"
#include "c.h"
+#include "closestream.h"
static void __attribute__ ((__noreturn__)) usage(FILE * out)
{
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
while ((ch = getopt_long(argc, argv, "Vh", longopts, NULL)) != -1)
switch (ch) {
#include "c.h"
#include "cyclades.h"
+#include "closestream.h"
#include "strutils.h"
#if 0
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
while ((i =
getopt_long(argc, argv, "qs:S:t:T:gGi:Vh", longopts,
#include "widechar.h"
#include "writeall.h"
#include "bitops.h"
+#include "closestream.h"
/* Close the log. Currently a NOP. */
#define SYSLOG_ACTION_CLOSE 0
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
while ((c = getopt_long(argc, argv, "CcDdEF:f:hkl:n:rs:TtuVx",
longopts, NULL)) != -1) {
#include "nls.h"
#include "strutils.h"
#include "c.h"
-
+#include "closestream.h"
static void __attribute__((__noreturn__)) usage(FILE *out)
{
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
while ((c = getopt_long(argc, argv, "hVnpl:o:", longopts, NULL)) != -1) {
switch(c) {
#include "c.h"
#include "nls.h"
#include "strutils.h"
+#include "closestream.h"
static void __attribute__((__noreturn__)) usage(int ex)
{
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
if (argc < 2)
usage(EX_USAGE);
#include "blkdev.h"
#include "nls.h"
+#include "closestream.h"
#include "c.h"
static int freeze_f(int fd)
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
while ((c = getopt_long(argc, argv, "hfu", longopts, NULL)) != -1) {
switch(c) {
#include "nls.h"
#include "strutils.h"
#include "c.h"
+#include "closestream.h"
#ifndef FITRIM
struct fstrim_range {
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
memset(&range, 0, sizeof(range));
range.len = ULLONG_MAX;
#include "c.h"
#include "nls.h"
#include "strutils.h"
+#include "closestream.h"
key_t create_key(void)
{
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
while((opt = getopt_long(argc, argv, "hM:QS:p:Vh", longopts, NULL)) != -1) {
switch(opt) {
#include "c.h"
#include "nls.h"
#include "strutils.h"
+#include "closestream.h"
#ifndef HAVE_UNION_SEMUN
/* according to X/OPEN we have to define it ourselves */
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
/* check to see if the command is being invoked in the old way if so
* then remove argument list */
#include "c.h"
#include "nls.h"
+#include "closestream.h"
/*
* SHM_DEST and SHM_LOCKED are defined in kernel headers, but inside
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
while ((opt = getopt_long(argc, argv, options, longopts, NULL)) != -1) {
switch (opt) {
#include "c.h"
#include "nls.h"
#include "strutils.h"
+#include "closestream.h"
#ifndef N_GIGASET_M101
# define N_GIGASET_M101 16
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
/* parse options */
progname = program_invocation_short_name;
#include "strutils.h"
#include "loopdev.h"
#include "xgetpass.h"
+#include "closestream.h"
enum {
A_CREATE = 1, /* setup a new device */
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
loopcxt_init(&lc, 0);
loopcxt_enable_debug(&lc, getenv("LOOPDEV_DEBUG") ? TRUE : FALSE);
#include "bitops.h"
#include "tt.h"
#include "path.h"
+#include "closestream.h"
#define CACHE_MAX 100
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
while ((c = getopt_long(argc, argv, "abce::hp::s:xV", longopts, NULL)) != -1) {
#include "xgetpass.h"
#include "exitcodes.h"
#include "xalloc.h"
+#include "closestream.h"
/*** TODO: DOCS:
*
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
mnt_init_debug(0);
cxt = mnt_new_context();
#include "nls.h"
#include "xalloc.h"
#include "c.h"
+#include "closestream.h"
static int quiet;
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
mnt_init_debug(0);
#include "c.h"
#include "nls.h"
+#include "closestream.h"
#define pivot_root(new_root,put_old) syscall(SYS_pivot_root,new_root,put_old)
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
while ((ch = getopt_long(argc, argv, "Vh", longopts, NULL)) != -1)
switch (ch) {
#include "xalloc.h"
#include "strutils.h"
#include "list.h"
+#include "closestream.h"
#ifndef RLIMIT_RTTIME
# define RLIMIT_RTTIME 15
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
INIT_LIST_HEAD(&lims);
#include "nls.h"
#include "xalloc.h"
+#include "closestream.h"
#define S_LEN 128
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
proFile = defaultpro;
mapFile = defaultmap;
#include <errno.h>
#include "nls.h"
#include "c.h"
+#include "closestream.h"
static int donice(int,int,int);
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
argc--;
argv++;
#include "usleep.h"
#include "strutils.h"
#include "c.h"
+#include "closestream.h"
/* constants from legacy PC/AT hardware */
#define RTC_PF 0x40
}
/* this executes after wake from suspend */
- fclose(f);
+ if (close_stream(f))
+ errx(EXIT_FAILURE, _("write error"));
}
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
while ((t = getopt_long(argc, argv, "ahd:lm:ns:t:uVv",
long_options, NULL)) != EOF) {
#include <sys/utsname.h>
#include "nls.h"
#include "c.h"
+#include "closestream.h"
#define set_pers(pers) ((long)syscall(SYS_personality, pers))
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
if (argc < 1)
show_usage(_("Not enough arguments"));
#include "c.h"
#include "nls.h"
+#include "closestream.h"
static void __attribute__ ((__noreturn__)) usage(FILE * out)
{
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
while ((ch = getopt_long(argc, argv, "+Vhc", longopts, NULL)) != -1)
switch (ch) {
#include "canonicalize.h"
#include "xalloc.h"
#include "c.h"
+#include "closestream.h"
#define PATH_MKSWAP "/sbin/mkswap"
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
progname = program_invocation_short_name;
if (!progname) {
#include "c.h"
#include "nls.h"
+#include "closestream.h"
#ifndef MS_MOVE
#define MS_MOVE 8192
int main(int argc, char *argv[])
{
char *newroot, *init, **initargs;
+ atexit(close_stdout);
if (argv[1] && (!strcmp(argv[1], "--help") || !strcmp(argv[1], "-h")))
usage(stdout);
#include "lp.h"
#include "nls.h"
#include "xalloc.h"
+#include "closestream.h"
#define EXIT_BAD_VALUE 3
#define EXIT_LP_IO_ERR 4
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
if (argc < 2)
print_usage(stderr);
#include "env.h"
#include "optutils.h"
#include "exitcodes.h"
+#include "closestream.h"
static int table_parser_errcb(struct libmnt_table *tb __attribute__((__unused__)),
const char *filename, int line)
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
mnt_init_debug(0);
cxt = mnt_new_context();
#include "nls.h"
#include "c.h"
+#include "closestream.h"
#ifndef CLONE_NEWSNS
# define CLONE_NEWNS 0x00020000
setlocale(LC_MESSAGES, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
while((c = getopt_long(argc, argv, "hVmuin", longopts, NULL)) != -1) {
switch(c) {