-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Open
Labels
Description
In #966 what finally helped tracking down the bug was replacing all close() calls with a call to this macro
#define openvpn_close_socket(s) ({ int r; msg(D_DCO_DEBUG, "%s: openvpn_close_socket(%d)", __func__, (int)s); r = close(s); r; })
my understanding is that this is GCC specific (the bit about the int r; ... ; r; giving the macro the return value of close(s)), so it needs to be conditional.
Also, it needs a good home (not socket.h), and maybe be called openvpn_close() or such... and a decision on the right loglevel to use.
But I guess with multisockets and inotify, there might be more file descriptor hunting coming up, and making this something one can just switch on might come in handy.
Reactions are currently unavailable