On 2014/11/28 15:29, Markus Armbruster wrote: > Since this is main(), the "caller" is the OS. And yes, the OS closes > the -f file descriptor when main() returns, because it closes *all* file > descriptors. Calling close() before return from main() is pointless, > unless you check for errors. > > Unfortunately, Coverity doesn't understand this. Calling close() in > main() suppresses its bogus defect report. >
Yes. >>> >> If sock >= 0 is pointless, too, but needed to hush up Coverity. >> > >> > You mean do not check sock_name is NULL or not? > Yes, unless it causes another bogus Coverity defect. > > Or simply mark the defect as invalid and move on without patching the > code. Let's drop this patch, thanks. Regards, -Gonglei
