Making a port part II : bind: Who ate a byte ?

abi abi at
Tue Apr 26 19:27:21 UTC 2016


I'm porting ZoneMinder and making pull requests to avoid FreeBSD 
specific patches as upstream is happy to merge them.

I've noticed that sock files ZM creates has 'soc' extension. This make 
these file haunt sock folder as they are not cleared for obvious reason 
after they are not needed.

The code, that produces such effect is here:
If I increment buffer to 1 (strlen() + sizeof() + 1) created files have 
correct endings.

I can just add +1 if platform is FreeBSD and send this to upstream, 
however, being not a programmer, I can't tell why it's happening. The 
code looks generic enough to work on any posix system. How can we lost 
the byte here? Maybe there is a more proper solution, without #if ?

More information about the freebsd-ports mailing list