{"action":"created","issue":{"url":"https://api.github.com/repos/edenhill/kafkacat/issues/26","labels_url":"https://api.github.com/repos/edenhill/kafkacat/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/edenhill/kafkacat/issues/26/comments","events_url":"https://api.github.com/repos/edenhill/kafkacat/issues/26/events","html_url":"https://github.com/edenhill/kafkacat/issues/26","id":55004970,"number":26,"title":"Use `fflush()` after `fwrite()` to allow consumer to be piped to another process","user":{"login":"vincentbernat","id":631446,"avatar_url":"https://avatars.githubusercontent.com/u/631446?v=3","gravatar_id":"","url":"https://api.github.com/users/vincentbernat","html_url":"https://github.com/vincentbernat","followers_url":"https://api.github.com/users/vincentbernat/followers","following_url":"https://api.github.com/users/vincentbernat/following{/other_user}","gists_url":"https://api.github.com/users/vincentbernat/gists{/gist_id}","starred_url":"https://api.github.com/users/vincentbernat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vincentbernat/subscriptions","organizations_url":"https://api.github.com/users/vincentbernat/orgs","repos_url":"https://api.github.com/users/vincentbernat/repos","events_url":"https://api.github.com/users/vincentbernat/events{/privacy}","received_events_url":"https://api.github.com/users/vincentbernat/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-21T11:05:00Z","updated_at":"2015-01-21T11:06:45Z","closed_at":"2015-01-21T11:06:45Z","body":"Hi!\r\n\r\nCurrently, if we do `kafkacat -C | someprogram`, even when the target program is handling unbuffered input, we don't get the last few received messages because the libc is buffering `fwrite()` output when it is not a terminal. Adding a `fflush(fp)` solves this issue."},"comment":{"url":"https://api.github.com/repos/edenhill/kafkacat/issues/comments/70819786","html_url":"https://github.com/edenhill/kafkacat/issues/26#issuecomment-70819786","issue_url":"https://api.github.com/repos/edenhill/kafkacat/issues/26","id":70819786,"user":{"login":"vincentbernat","id":631446,"avatar_url":"https://avatars.githubusercontent.com/u/631446?v=3","gravatar_id":"","url":"https://api.github.com/users/vincentbernat","html_url":"https://github.com/vincentbernat","followers_url":"https://api.github.com/users/vincentbernat/followers","following_url":"https://api.github.com/users/vincentbernat/following{/other_user}","gists_url":"https://api.github.com/users/vincentbernat/gists{/gist_id}","starred_url":"https://api.github.com/users/vincentbernat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vincentbernat/subscriptions","organizations_url":"https://api.github.com/users/vincentbernat/orgs","repos_url":"https://api.github.com/users/vincentbernat/repos","events_url":"https://api.github.com/users/vincentbernat/events{/privacy}","received_events_url":"https://api.github.com/users/vincentbernat/received_events","type":"User","site_admin":false},"created_at":"2015-01-21T11:06:45Z","updated_at":"2015-01-21T11:06:45Z","body":"Well, there is the `-u` option just for that. I had to post the issue to find it. ;-)"}}