mirror of
https://gitlab.com/chrony/chrony.git
synced 2026-01-21 05:10:19 -05:00
Check return value of chmod() and fcntl()
This commit is contained in:
6
util.c
6
util.c
@@ -647,7 +647,7 @@ UTI_FloatHostToNetwork(double x)
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
void
|
||||
int
|
||||
UTI_FdSetCloexec(int fd)
|
||||
{
|
||||
int flags;
|
||||
@@ -655,8 +655,10 @@ UTI_FdSetCloexec(int fd)
|
||||
flags = fcntl(fd, F_GETFD);
|
||||
if (flags != -1) {
|
||||
flags |= FD_CLOEXEC;
|
||||
fcntl(fd, F_SETFD, flags);
|
||||
return !fcntl(fd, F_SETFD, flags);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
Reference in New Issue
Block a user