summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2021-06-25 09:48:13 +0200
committerThomas Haller <thaller@redhat.com>2021-07-01 11:04:22 +0200
commitf9f453994b6944005ee5e779eed34a3a32111c78 (patch)
tree1dac7d061f228ce94a1ff6cdd015809c3532b8fa
parent2b55408cc79831860a6b6585b2d4d8ac4f6cd20f (diff)
downloadNetworkManager-f9f453994b6944005ee5e779eed34a3a32111c78.tar.gz
glib-aux: use NM_AUTO_PROTECT_ERRNO() in nm_auto_close and nm_auto_fclose
-rw-r--r--src/libnm-std-aux/nm-std-aux.h8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/libnm-std-aux/nm-std-aux.h b/src/libnm-std-aux/nm-std-aux.h
index 074c8a0b25..947ca36033 100644
--- a/src/libnm-std-aux/nm-std-aux.h
+++ b/src/libnm-std-aux/nm-std-aux.h
@@ -835,10 +835,8 @@ static inline void
_nm_auto_close(int *pfd)
{
if (*pfd >= 0) {
- int errsv = errno;
-
+ NM_AUTO_PROTECT_ERRNO(errsv);
(void) nm_close(*pfd);
- errno = errsv;
}
}
#define nm_auto_close nm_auto(_nm_auto_close)
@@ -847,10 +845,8 @@ static inline void
_nm_auto_fclose(FILE **pfd)
{
if (*pfd) {
- int errsv = errno;
-
+ NM_AUTO_PROTECT_ERRNO(errsv);
(void) fclose(*pfd);
- errno = errsv;
}
}
#define nm_auto_fclose nm_auto(_nm_auto_fclose)