mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-23 19:00:34 +01:00
glib-aux: use NM_AUTO_PROTECT_ERRNO() in nm_auto_close and nm_auto_fclose
This commit is contained in:
parent
2b55408cc7
commit
f9f453994b
1 changed files with 2 additions and 6 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue