#include "c.h"
#include "env.h"
+#include "closestream.h"
#include "islocal.h"
#include "nls.h"
#include "pamfail.h"
setlocale(LC_ALL, ""); /* both for messages and for iscntrl() below */
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
/*
* "oldf" contains the users original finger information.
#include "c.h"
#include "env.h"
+#include "closestream.h"
#include "islocal.h"
#include "nls.h"
#include "pamfail.h"
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
uid = getuid();
memset(&info, 0, sizeof(info));
#include <stdio.h>
#include <stdlib.h>
+#include "closestream.h"
#include "islocal.h"
#include "nls.h"
#include "pathnames.h"
#ifdef TEST_PROGRAM
int main(int argc, char *argv[])
{
+ atexit(close_stdout);
if (argc <= 2) {
fprintf(stderr, "usage: %s <passwdfile> <username> [...]\n",
argv[0]);
#include <netinet/in.h>
#include <arpa/inet.h>
+#include "closestream.h"
#include "pathnames.h"
#include "nls.h"
#include "xalloc.h"
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
while ((ch = getopt(argc, argv, "0123456789yli:f:h:t:")) != -1)
switch((char)ch) {
#include <sys/syslog.h>
#include "c.h"
+#include "closestream.h"
#include "logindefs.h"
#include "nls.h"
#include "pathnames.h"
int main(int argc, char *argv[])
{
char *name, *type;
+ atexit(close_stdout);
if (argc <= 1)
errx(EXIT_FAILURE, "usage: %s <filename> "
#endif
#include "c.h"
+#include "closestream.h"
#include "nls.h"
#include "pathnames.h"
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
while ((ch = getopt_long(argc, argv, "Vh", longopts, NULL)) != -1)
switch (ch) {
#include <unistd.h>
#include "c.h"
-#include "fileutils.h"
+#include "closestream.h"
#include "setpwnam.h"
static void pw_init(void);
/* xfmkstemp is too restrictive by default for passwd file */
if (fchmod(fileno(fp), 0644) < 0)
goto fail;
- rc = fclose(fp);
- fp = NULL;
- if (rc < 0)
+ if (close_stream(fp) != 0)
goto fail;
fclose(pwf); /* I don't think I want to know if this failed */
#endif
#include "c.h"
+#include "closestream.h"
#include "nls.h"
#include "pathnames.h"
#include "strutils.h"
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
/*
* See if we have a timeout flag.
#include <unistd.h>
#include "c.h"
-#include "fileutils.h"
+#include "closestream.h"
#include "nls.h"
#include "setpwnam.h"
#include "strutils.h"
ch_ret = fchmod(fileno(tmp_fd), 0400);
if (ch_ret < 0)
err(EXIT_FAILURE, "%s: %s", _("cannot chmod file"), orig_file);
- fclose(tmp_fd);
+ if (close_stream(tmp_fd) != 0)
+ err(EXIT_FAILURE, _("write error"));
pw_write();
close(passwd_file);
ulckpwdf();
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
if (!strcmp(program_invocation_short_name, "vigr")) {
program = VIGR;