From 8dd16caec833aebde3a12c7d7f9b6456554c8616 Mon Sep 17 00:00:00 2001 From: Oran Agra Date: Fri, 8 Jan 2021 23:35:30 +0200 Subject: Fix last COW INFO report, Skip test on non-linux platforms (#8301) - the last COW report wasn't always read from the pipe (receiveLastChildInfo wasn't used) - but in fact, there's no reason we won't always try to drain that pipe so i'm unifying receiveLastChildInfo with receiveChildInfo - adjust threshold of the COW test when run in accurate mode - add some prints in case this test fails again - fix indentation, page size, and PID! in MacOS proc info p.s. it seems that pri_pages_dirtied is always 0 --- src/childinfo.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'src/childinfo.c') diff --git a/src/childinfo.c b/src/childinfo.c index 85adfe2f6..cae73fe46 100644 --- a/src/childinfo.c +++ b/src/childinfo.c @@ -124,24 +124,12 @@ int readChildInfo(int *process_type, int *on_exit, size_t *cow_size) { void receiveChildInfo(void) { if (server.child_info_pipe[0] == -1) return; - int process_type; - int on_exit; - size_t cow_size; - if (readChildInfo(&process_type, &on_exit, &cow_size)) { - updateChildInfo(process_type, on_exit, cow_size); - } -} - -/* Receive last COW data from child. */ -void receiveLastChildInfo(void) { - if (server.child_info_pipe[0] == -1) return; - - /* Drain the pipe and update child info */ int process_type; int on_exit; size_t cow_size; - while (readChildInfo(&process_type, &on_exit, &cow_size) > 0) { + /* Drain the pipe and update child info so that we get the final message. */ + while (readChildInfo(&process_type, &on_exit, &cow_size)) { updateChildInfo(process_type, on_exit, cow_size); } } -- cgit v1.2.1