From: Aki Tuomi Date: Thu, 21 Feb 2019 16:50:10 +0000 (+0200) Subject: lib-program-client: test-program-client-local - Use dd instead of head X-Git-Tag: 2.3.18~250 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1b13ee113b1b616d2a1cb0361d228639aff4a5c9;p=thirdparty%2Fdovecot%2Fcore.git lib-program-client: test-program-client-local - Use dd instead of head `head -c n` is only guaranteed to print n bytes, but it may consume more. FreeBSD's implementation of head(1) uses buffered stdio, which did just that. `dd` consumes exactly the specified number of bytes. --- diff --git a/src/lib-program-client/test-program-client-local.c b/src/lib-program-client/test-program-client-local.c index 03e24015cd..2040b15581 100644 --- a/src/lib-program-client/test-program-client-local.c +++ b/src/lib-program-client/test-program-client-local.c @@ -178,12 +178,12 @@ static void test_program_io_big(void) and then finally reads the rest in one go. */ const char *const args[] = { "-c", - "(head -c 10240; sleep 0.1; " - "head -c 10240; sleep 0.1; " - "head -c 10240; sleep 0.1; " - "head -c 10240; sleep 0.1; " - "head -c 10240; sleep 0.1; " - "head -c 10240; sleep 0.1; cat)", + "(dd bs=10240 count=1; sleep 0.1; " + "dd bs=10240 count=1; sleep 0.1; " + "dd bs=10240 count=1; sleep 0.1; " + "dd bs=10240 count=1; sleep 0.1; " + "dd bs=10240 count=1; sleep 0.1; " + "dd bs=10240 count=1; sleep 0.1; cat) 2>/dev/null", NULL };