protocol: fix incorrect uv_close usage

This commit is contained in:
Shuanglei Tao
2020-12-27 13:16:29 +08:00
parent 75c9004dd1
commit 5650606674
2 changed files with 12 additions and 3 deletions

View File

@@ -1,6 +1,12 @@
#ifndef TTYD_UTIL_H
#define TTYD_UTIL_H
#define container_of(ptr, type, member) \
({ \
const typeof(((type *)0)->member) *__mptr = (ptr); \
(type *)((char *)__mptr - offsetof(type, member)); \
})
// malloc with NULL check
void *xmalloc(size_t size);