Signed-off-by: Sami Kerola <kerolasa@iki.fi>
#include <sys/types.h>
#include <sys/stat.h>
#include <getopt.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <getopt.h>
+
+#include "closestream.h"
#include "nls.h"
#include "c.h"
#include "nls.h"
#include "c.h"
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
static const struct option longopts[] = {
{ "verbose", no_argument, 0, 'v' },
static const struct option longopts[] = {
{ "verbose", no_argument, 0, 'v' },
#include <locale.h>
#include <stddef.h>
#include <locale.h>
#include <stddef.h>
+#include "closestream.h"
#include "nls.h"
#include "c.h"
#include "nls.h"
#include "c.h"
setlocale(LC_NUMERIC, "C"); /* see comment above */
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
setlocale(LC_NUMERIC, "C"); /* see comment above */
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
while ((ch = getopt_long(argc, argv, "ac:efqt::Vh", longopts, NULL)) != -1)
switch(ch) {
while ((ch = getopt_long(argc, argv, "ac:efqt::Vh", longopts, NULL)) != -1)
switch(ch) {
+ if (close_stream(timingfd) != 0)
+ errx(EXIT_FAILURE, _("write error"));
ssize_t cc;
char ibuf[BUFSIZ];
ssize_t cc;
char ibuf[BUFSIZ];
+ if (close_stream(fscript) != 0)
+ errx(EXIT_FAILURE, _("write error"));
while (die == 0) {
if ((cc = read(STDIN_FILENO, ibuf, BUFSIZ)) > 0) {
while (die == 0) {
if ((cc = read(STDIN_FILENO, ibuf, BUFSIZ)) > 0) {
if (flgs)
fcntl(master, F_SETFL, flgs);
if (flgs)
fcntl(master, F_SETFL, flgs);
+ if (close_stream(timingfd) != 0)
+ errx(EXIT_FAILURE, _("write error"));
getslave();
close(master);
getslave();
close(master);
+ if (close_stream(fscript) != 0)
+ errx(EXIT_FAILURE, _("write error"));
dup2(slave, STDIN_FILENO);
dup2(slave, STDOUT_FILENO);
dup2(slave, STDERR_FILENO);
dup2(slave, STDIN_FILENO);
dup2(slave, STDOUT_FILENO);
dup2(slave, STDERR_FILENO);
my_strftime(buf, sizeof buf, "%c\n", localtime(&tvec));
fprintf(fscript, _("\nScript done on %s"), buf);
}
my_strftime(buf, sizeof buf, "%c\n", localtime(&tvec));
fprintf(fscript, _("\nScript done on %s"), buf);
}
+ if (close_stream(fscript) != 0)
+ errx(EXIT_FAILURE, _("write error"));
close(master);
master = -1;
close(master);
master = -1;
#include <unistd.h>
#include <getopt.h>
#include <unistd.h>
#include <getopt.h>
+#include "closestream.h"
#include "nls.h"
#include "c.h"
#include "nls.h"
#include "c.h"
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
while ((ch = getopt_long(argc, argv, "t:s:d:Vh", longopts, NULL)) != -1)
switch(ch) {
while ((ch = getopt_long(argc, argv, "t:s:d:Vh", longopts, NULL)) != -1)
switch(ch) {
#include "c.h"
#include "xalloc.h"
#include "nls.h"
#include "c.h"
#include "xalloc.h"
#include "nls.h"
+#include "closestream.h"
#if __GNU_LIBRARY__ < 5
#ifndef __alpha__
#if __GNU_LIBRARY__ < 5
#ifndef __alpha__
err(EXIT_DUMPFILE, _("can not open dump file %s for output"),
opt_sn_name);
screendump(opt_sn_num, F);
err(EXIT_DUMPFILE, _("can not open dump file %s for output"),
opt_sn_name);
screendump(opt_sn_num, F);
+ if (close_stream(F) != 0)
+ errx(EXIT_FAILURE, _("write error"));
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
if (argc < 2)
bad_arg = TRUE;
if (argc < 2)
bad_arg = TRUE;
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+#include "nls.h"
+#include "closestream.h"
#include "pathnames.h"
#include "ttymsg.h"
#include "pathnames.h"
#include "ttymsg.h"
#include "carefulputc.h"
#include "c.h"
#include "fileutils.h"
#include "carefulputc.h"
#include "c.h"
#include "fileutils.h"
+#include "closestream.h"
#define IGNOREUSER "sleeper"
#define WRITE_TIME_OUT 300 /* in seconds */
#define IGNOREUSER "sleeper"
#define WRITE_TIME_OUT 300 /* in seconds */
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
static const struct option longopts[] = {
{ "nobanner", no_argument, 0, 'n' },
static const struct option longopts[] = {
{ "nobanner", no_argument, 0, 'n' },
if (fread(mbuf, 1, *mbufsize, fp) != *mbufsize)
err(EXIT_FAILURE, _("fread failed"));
if (fread(mbuf, 1, *mbufsize, fp) != *mbufsize)
err(EXIT_FAILURE, _("fread failed"));
+ if (close_stream(fp) != 0)
+ errx(EXIT_FAILURE, _("write error"));
#include <paths.h>
#include <asm/param.h>
#include <getopt.h>
#include <paths.h>
#include <asm/param.h>
#include <getopt.h>
#include "c.h"
#include "carefulputc.h"
#include "c.h"
#include "carefulputc.h"
+#include "closestream.h"
#include "nls.h"
static void __attribute__ ((__noreturn__)) usage(FILE * out);
#include "nls.h"
static void __attribute__ ((__noreturn__)) usage(FILE * out);
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
while ((c = getopt_long(argc, argv, "Vh", longopts, NULL)) != -1)
switch (c) {
while ((c = getopt_long(argc, argv, "Vh", longopts, NULL)) != -1)
switch (c) {