Hi David, Thanks for review, hopefully this patch will addresses most of the sutff. Rest I will address here.
> > > + const char *procdir = "/proc/self/fd/"; > > self is a Linux thing. > This won't work on FreeBSD. IMHO original code didn't worked on FreeBSD as well. I have created function to adress in third patch > No need to set status, this (forked) process will panic. I am using status to save errno as it value can be overwritten on unlikely event of closedir failure. --- v3 changes: add missing closedir fix strtol string validation test removed empty line remove unecssary initalization add check for '.' and '..' to avoid errors in parsing entries fix commit message add FreeBSD function for closing files v2 changes: fix commit message Krzysztof Kanas (3): test: fix timeout in flags autotest test: move close files to separate function test: fix FreeBSD file closing function process.h | 183 ++++++++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 138 insertions(+), 45 deletions(-)