[PATCH 12/19] rev: reduce stream checking when closing read-only file descriptor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Sami Kerola <kerolasa@xxxxxx>
---
 text-utils/rev.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/text-utils/rev.c b/text-utils/rev.c
index 1665772..1c44036 100644
--- a/text-utils/rev.c
+++ b/text-utils/rev.c
@@ -161,14 +161,11 @@ int main(int argc, char *argv[])
 			if (!feof(fp))
 				putwchar('\n');
 		}
-
-		fflush(fp);
 		if (ferror(fp)) {
 			warn("%s", filename);
 			rval = EXIT_FAILURE;
 		}
-		if (fclose(fp))
-			rval = EXIT_FAILURE;
+		fclose(fp);
 	} while(*argv);
 
 	free(buf);
-- 
1.8.3

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux