[LTP] Test library API changes
Cyril Hrubis
chrubis@suse.cz
Wed Feb 10 12:41:34 CET 2016
Hi!
> 4. suggestion: improved safeguard for cleanup
> Record pid of main process at start and call cleanup only if current
> pid is recorded pid. This doesn't make it depend on using specific
> API call to run child process.
You are right, we should avoid calling cleanup() and internal do_exit()
in case that process was forked by plain tst_fork(), which is reasonable
action if process needs child and do not need to use tst_resm()
reporting inside. I would say that not doing exit(0) from the child is a
mistake in this case, but we should certainly at least issue an error
message. And also we must not call the callback if such child called
tst_brk(TBROK,..) (which is desirable so that we can use SAFE_MACROS()
in such cases).
--
Cyril Hrubis
chrubis@suse.cz
More information about the Ltp
mailing list