summary refs log tree commit diff
path: root/shared/nm-std-aux/nm-std-aux.h
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2021-08-16 09:51:46 +0200
committerMichael Biebl <biebl@debian.org>2021-08-16 09:51:46 +0200
commitbfe522304da217296e2a61040f58e35ec5d6f3f2 (patch)
tree6c4296644fa59cbfe51d9e8aafebddace5ac6b6f /shared/nm-std-aux/nm-std-aux.h
parent3a56bce6c0ea7ba0fe269520547740783b342e0d (diff)
New upstream version 1.30.6 upstream/1.30.6
Diffstat (limited to 'shared/nm-std-aux/nm-std-aux.h')
-rw-r--r--shared/nm-std-aux/nm-std-aux.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/shared/nm-std-aux/nm-std-aux.h b/shared/nm-std-aux/nm-std-aux.h
index 30adeb58..a619cebd 100644
--- a/shared/nm-std-aux/nm-std-aux.h
+++ b/shared/nm-std-aux/nm-std-aux.h
@@ -695,6 +695,14 @@ nm_close(int fd)
 NM_AUTO_DEFINE_FCN_VOID0(void *, _nm_auto_free_impl, free);
 #define nm_auto_free nm_auto(_nm_auto_free_impl)
 
+static inline void
+_nm_auto_protect_errno(const int *p_saved_errno)
+{
+    errno = *p_saved_errno;
+}
+#define NM_AUTO_PROTECT_ERRNO(errsv_saved) \
+    nm_auto(_nm_auto_protect_errno) _nm_unused const int errsv_saved = (errno)
+
 /*****************************************************************************/
 
 static inline void