From: Richard Kettlewell Date: Mon, 11 Jul 2011 18:44:18 +0000 (+0100) Subject: sys_cmd error handling improved. X-Git-Tag: v0.2.0~45 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/secnet/commitdiff_plain/baab3a63ada033b2b9eed46807b2e88536612bbc?hp=baab3a63ada033b2b9eed46807b2e88536612bbc sys_cmd error handling improved. (1) If the subprocess exits nonzero then the exit status is unpicked and logged. (2) If the exec in the child fails, the command and errno string are written to stderr (which should end up in secnet's usual log output). (3) _exit() is used instead of exit(), to avoid any possibility of craziness with stdio/atexit/etc. Signed-off-by: Richard Kettlewell ---