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

abi abi at abinet.ru
Tue Apr 26 19:27:21 UTC 2016


Hello,

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:
https://github.com/ZoneMinder/ZoneMinder/blob/247cb3d0b2adb8941bd1cd400cf783bdfc71832d/src/zm_stream.cpp#L326
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