Skip to content

add instrumentation around close() calls #967

@cron2

Description

@cron2

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions