<p>Corey Farrell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/7115">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">DEBUG_FD_LEAKS: Add support for eventfd and timerfd_create.<br><br>This causes eventfd and timerfd to be recognized by DEBUG_FD_LEAKS.<br><br>ASTERISK-27404<br><br>Change-Id: Id6848fe904ade2d34eb39d2a20bd6b223e1111fc<br>---<br>M include/asterisk.h<br>M main/astfd.c<br>2 files changed, 40 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/15/7115/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/include/asterisk.h b/include/asterisk.h<br>index 899438b..a608c09 100644<br>--- a/include/asterisk.h<br>+++ b/include/asterisk.h<br>@@ -72,6 +72,16 @@<br> int __ast_fdleak_open(const char *file, int line, const char *func, const char *path, int flags, ...);<br> int __ast_fdleak_pipe(int *fds, const char *file, int line, const char *func);<br> int __ast_fdleak_socket(int domain, int type, int protocol, const char *file, int line, const char *func);<br>+#if defined(HAVE_EVENTFD)<br>+#include <sys/eventfd.h><br>+#define eventfd(a,b)     __ast_fdleak_eventfd(a,b, __FILE__,__LINE__,__PRETTY_FUNCTION__)<br>+int __ast_fdleak_eventfd(unsigned int initval, int flags, const char *file, int line, const char *func);<br>+#endif<br>+#if defined(HAVE_TIMERFD)<br>+#include <sys/timerfd.h><br>+#define timerfd_create(a,b) __ast_fdleak_timerfd_create(a,b, __FILE__,__LINE__,__PRETTY_FUNCTION__)<br>+int __ast_fdleak_timerfd_create(int clockid, int flags, const char *file, int line, const char *func);<br>+#endif<br> int __ast_fdleak_close(int fd);<br> FILE *__ast_fdleak_fopen(const char *path, const char *mode, const char *file, int line, const char *func);<br> int __ast_fdleak_fclose(FILE *ptr);<br>diff --git a/main/astfd.c b/main/astfd.c<br>index 34cf7bb..cabaebb 100644<br>--- a/main/astfd.c<br>+++ b/main/astfd.c<br>@@ -147,6 +147,36 @@<br>        return 0;<br> }<br> <br>+#if defined(HAVE_EVENTFD)<br>+#undef eventfd<br>+#include <sys/eventfd.h><br>+int __ast_fdleak_eventfd(unsigned int initval, int flags, const char *file, int line, const char *func)<br>+{<br>+ int res = eventfd(initval, flags);<br>+<br>+        if (res >= 0) {<br>+           STORE_COMMON(res, "eventfd", "{%d}", res);<br>+       }<br>+<br>+ return res;<br>+}<br>+#endif<br>+<br>+#if defined(HAVE_TIMERFD)<br>+#undef timerfd_create<br>+#include <sys/timerfd.h><br>+int __ast_fdleak_timerfd_create(int clockid, int flags, const char *file, int line, const char *func)<br>+{<br>+ int res = timerfd_create(clockid, flags);<br>+<br>+ if (res >= 0) {<br>+           STORE_COMMON(res, "timerfd_create", "{%d}", res);<br>+        }<br>+<br>+ return res;<br>+}<br>+#endif<br>+<br> #undef socket<br> int __ast_fdleak_socket(int domain, int type, int protocol, const char *file, int line, const char *func)<br> {<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/7115">change 7115</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/7115"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Id6848fe904ade2d34eb39d2a20bd6b223e1111fc </div>
<div style="display:none"> Gerrit-Change-Number: 7115 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>