mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-07 04:58:01 +02:00
glib-aux: use NM_AUTO_PROTECT_ERRNO() in nm_auto_close and nm_auto_fclose
(cherry picked from commit f9f453994b)
This commit is contained in:
parent
309eba1078
commit
29d64f148e
1 changed files with 2 additions and 6 deletions
|
|
@ -709,10 +709,8 @@ static inline void
|
||||||
_nm_auto_close(int *pfd)
|
_nm_auto_close(int *pfd)
|
||||||
{
|
{
|
||||||
if (*pfd >= 0) {
|
if (*pfd >= 0) {
|
||||||
int errsv = errno;
|
NM_AUTO_PROTECT_ERRNO(errsv);
|
||||||
|
|
||||||
(void) nm_close(*pfd);
|
(void) nm_close(*pfd);
|
||||||
errno = errsv;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#define nm_auto_close nm_auto(_nm_auto_close)
|
#define nm_auto_close nm_auto(_nm_auto_close)
|
||||||
|
|
@ -721,10 +719,8 @@ static inline void
|
||||||
_nm_auto_fclose(FILE **pfd)
|
_nm_auto_fclose(FILE **pfd)
|
||||||
{
|
{
|
||||||
if (*pfd) {
|
if (*pfd) {
|
||||||
int errsv = errno;
|
NM_AUTO_PROTECT_ERRNO(errsv);
|
||||||
|
|
||||||
(void) fclose(*pfd);
|
(void) fclose(*pfd);
|
||||||
errno = errsv;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#define nm_auto_fclose nm_auto(_nm_auto_fclose)
|
#define nm_auto_fclose nm_auto(_nm_auto_fclose)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue