summaryrefslogtreecommitdiff
path: root/src/cksum.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cksum.c')
-rw-r--r--src/cksum.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cksum.c b/src/cksum.c
index d3ce0f8e..26571c7c 100644
--- a/src/cksum.c
+++ b/src/cksum.c
@@ -1,5 +1,5 @@
/* cksum -- calculate and print POSIX checksums and sizes of files
- Copyright (C) 1992-2012 Free Software Foundation, Inc.
+ Copyright (C) 1992-2013 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -290,6 +290,10 @@ main (int argc, char **argv)
atexit (close_stdout);
+ /* Line buffer stdout to ensure lines are written atomically and immediately
+ so that processes running in parallel do not intersperse their output. */
+ setvbuf (stdout, NULL, _IOLBF, 0);
+
parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE, Version,
usage, AUTHORS, (char const *) NULL);
if (getopt_long (argc, argv, "", NULL, NULL) != -1)