summaryrefslogtreecommitdiff
path: root/src/tac.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1998-05-07 17:45:10 +0000
committerJim Meyering <jim@meyering.net>1998-05-07 17:45:10 +0000
commit9bb85624cf39f4cc1963d49d06c925cd16f267c6 (patch)
tree60d83c821745e68a1b05b6d5d4274bf5bcef52c8 /src/tac.c
parent9b5402ec4896a8ded1bdb20c0c56d17618fe9109 (diff)
downloadcoreutils-9bb85624cf39f4cc1963d49d06c925cd16f267c6.tar.xz
fix up compile warnings
Diffstat (limited to 'src/tac.c')
-rw-r--r--src/tac.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/tac.c b/src/tac.c
index 3f362bd0e..9d5fddbb0 100644
--- a/src/tac.c
+++ b/src/tac.c
@@ -199,7 +199,6 @@ tac_stream (FILE *in, const char *file)
char *separator1 = separator + 1; /* Speed optimization, non-regexp. */
int match_length1 = match_length - 1; /* Speed optimization, non-regexp. */
struct re_registers regs;
- size_t x;
/* Find the size of the input file. */
file_pos = lseek (fileno (in), (off_t) 0, SEEK_END);
@@ -396,8 +395,13 @@ save_stdin (FILE **g_tmp, char **g_tempfile)
tempfile = mktemp (template);
fd = open (tempfile, O_RDWR | O_CREAT | O_TRUNC | O_EXCL, 0600);
- if (fd == -1 || (tmp = fdopen (fd, "w+")) == NULL)
+ if (fd == -1)
error (EXIT_FAILURE, errno, "%s", tempfile);
+
+ tmp = fdopen (fd, "w+");
+ if (tmp == NULL)
+ error (EXIT_FAILURE, errno, "%s", tempfile);
+
unlink (tempfile);
while ((bytes_read = fread (G_buffer, 1, read_size, stdin)) > 0