From 4145bb53bf1459022a7e00b26f29f2b91ee79974 Mon Sep 17 00:00:00 2001 From: Kirk McKusick Date: Fri, 30 Oct 2009 21:54:53 +0000 Subject: [PATCH] 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(+) diff --git a/usr.bin/logger/logger.c b/usr.bin/logger/logger.c index 5d9ec4df83b..90271052fdb 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;