chiark / gitweb /
Add _cleanup_pclose_ and fix mismatching pipe close opened by popen()
[elogind.git] / src / shared / macro.h
index 700171b8324e45bc2b4c48e1b01b5c8e486ff4ef..b307dedaa8bd6fc5fa379f5b715e6e97df7eaa0e 100644 (file)
@@ -196,9 +196,11 @@ static inline size_t IOVEC_INCREMENT(struct iovec *i, unsigned n, size_t k) {
 
 #define _cleanup_free_ __attribute__((cleanup(freep)))
 #define _cleanup_fclose_ __attribute__((cleanup(fclosep)))
+#define _cleanup_pclose_ __attribute__((cleanup(pclosep)))
 #define _cleanup_close_ __attribute__((cleanup(closep)))
 #define _cleanup_closedir_ __attribute__((cleanup(closedirp)))
 #define _cleanup_umask_ __attribute__((cleanup(umaskp)))
+#define _cleanup_set_free_ __attribute__((cleanup(set_freep)))
 #define _cleanup_strv_free_ __attribute__((cleanup(strv_freep)))
 
 #define VA_FORMAT_ADVANCE(format, ap)                                   \