Skip to content

Commit

Permalink
memory_utils: add close_move_fd()
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Feb 26, 2021
1 parent 83758a5 commit b02b2c8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lxc/memory_utils.h
Expand Up @@ -89,4 +89,10 @@ static inline void *memdup(const void *data, size_t len)
(a) = move_ptr((b)); \
})

#define close_move_fd(a, b) \
({ \
close(a); \
(a) = move_fd((b)); \
})

#endif /* __LXC_MEMORY_UTILS_H */

0 comments on commit b02b2c8

Please sign in to comment.