memory_utils: add close_move_fd()

parent 83758a55
...@@ -89,4 +89,10 @@ static inline void *memdup(const void *data, size_t len) ...@@ -89,4 +89,10 @@ static inline void *memdup(const void *data, size_t len)
(a) = move_ptr((b)); \ (a) = move_ptr((b)); \
}) })
#define close_move_fd(a, b) \
({ \
close(a); \
(a) = move_fd((b)); \
})
#endif /* __LXC_MEMORY_UTILS_H */ #endif /* __LXC_MEMORY_UTILS_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment