diff options
author | mckusick <mckusick@FreeBSD.org> | 2009-10-30 21:54:53 +0000 |
---|---|---|
committer | mckusick <mckusick@FreeBSD.org> | 2009-10-30 21:54:53 +0000 |
commit | 1f53d347029c3b07dacad99883a9946231b5efce (patch) | |
tree | 59f90eee9869de12ba6e96d0e1d70e46def7568f /usr.bin/logger | |
parent | 514b7768c10c7c81e87b123cbb5abaab67117494 (diff) | |
download | FreeBSD-src-1f53d347029c3b07dacad99883a9946231b5efce.zip FreeBSD-src-1f53d347029c3b07dacad99883a9946231b5efce.tar.gz |
When reading input from a file or device (via -f option) set the
input to be in non-buffering mode so that input lines are logged
as they occur rather than being saved up until a buffer's worth of
input has been logged.
Diffstat (limited to 'usr.bin/logger')
-rw-r--r-- | usr.bin/logger/logger.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/usr.bin/logger/logger.c b/usr.bin/logger/logger.c index 5d9ec4d..9027105 100644 --- a/usr.bin/logger/logger.c +++ b/usr.bin/logger/logger.c @@ -114,6 +114,7 @@ main(int argc, char *argv[]) case 'f': /* file to log */ if (freopen(optarg, "r", stdin) == NULL) err(1, "%s", optarg); + setvbuf(stdin, 0, _IONBF, 0); break; case 'h': /* hostname to deliver to */ host = optarg; |