cri-o/conmon
W. Trevor King 1262234531 conmon: Respect start-pipe read errors
Avoid:

  $ make clean && make conmon.o 2>&1
  rm -f conmon.o cmsg.o ../bin/conmon
  cc -std=c99 -Os -Wall -Wextra -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -DVERSION=\"1.9.0-dev\" -DGIT_COMMIT=\""74cd1ec97c13a9784ce5e67a9e50e8977b5d2f38"\"   -c -o conmon.o conmon.c
  conmon.c: In function ‘main’:
  conmon.c:1175:3: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
     read(start_pipe_fd, buf, BUF_SIZE);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

by catching and exiting on any read errors.  A read error here would
be because the caller died before writing to the start pipe, and we
don't want to continue in those cases because it would reopen the
cgroup race discussed in af4fbcd9 (conmon: Don't leave zombies and fix
cgroup race, 2017-06-09, #583).  af4fbcd9 is where this line
originally landed, and it didn't have error checking then.

Signed-off-by: W. Trevor King <wking@tremily.us>
2018-02-23 11:25:29 -08:00
..
cmsg.c conmon: implement logging to logPath 2017-04-05 02:45:57 +10:00
cmsg.h conmon: implement logging to logPath 2017-04-05 02:45:57 +10:00
conmon.c conmon: Respect start-pipe read errors 2018-02-23 11:25:29 -08:00
Makefile conmon: add new option --version 2018-02-23 09:41:48 +01:00