raboof / notion

Tiling tabbed window manager
https://notionwm.net/
GNU Lesser General Public License v2.1
268 stars 63 forks source link

mod_notionflux: Add ifdef for fchmod on FreeBSD (closes #350) #355

Open wilhelmy opened 1 year ago

wilhelmy commented 1 year ago

I guess this code could be removed. It might also not work on other BSD derivatives, but it seems no one has tried. It's the only place in the codebase that uses the __FreeBSD__ macro and fchmod on sockets that don't exist in the file system is probably not quite portable. Removing the code actually shouldn't add a race condition because although we're calling bind, since notion isn't multithreaded there is nothing actually reading from the socket before the function returns, so I think I'd rather remove it.

raboof commented 1 year ago

I guess this code could be removed. It might also not work on other BSD derivatives, but it seems no one has tried. It's the only place in the codebase that uses the __FreeBSD__ macro and fchmod on sockets that don't exist in the file system is probably not quite portable. Removing the code actually shouldn't add a race condition because although we're calling bind, since notion isn't multithreaded there is nothing actually reading from the socket before the function returns, so I think I'd rather remove it.

If you're confident, then I'd be happy to merge a PR just removing it (perhaps adding a comment with the background, for the unlikely case we'd ever add multithreading here)?