From 1f53d347029c3b07dacad99883a9946231b5efce Mon Sep 17 00:00:00 2001 From: mckusick Date: Fri, 30 Oct 2009 21:54:53 +0000 Subject: 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. --- usr.bin/logger/logger.c | 1 + 1 file changed, 1 insertion(+) (limited to 'usr.bin/logger/logger.c') 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; -- cgit v1.1