"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Anna “CyberTailor” <cyber+misc@sysrq.in>
Subject:
[PATCH] privsep.c: ignore closefrom() return value
To:
gameoftrees@openbsd.org
Date:
Mon, 6 Dec 2021 15:19:04 +0500

Download raw body.

Thread
closefrom(2) is void on FreeBSD and libbsd, so its return value has to
be ignored.

https://bugs.gentoo.org/828003
---
 lib/privsep.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/lib/privsep.c b/lib/privsep.c
index ca518be1..8f233724 100644
--- a/lib/privsep.c
+++ b/lib/privsep.c
@@ -2766,10 +2766,8 @@ got_privsep_exec_child(int imsg_fds[2], const char *path, const char *repo_path)
 		fprintf(stderr, "%s: %s\n", getprogname(), strerror(errno));
 		_exit(1);
 	}
-	if (closefrom(GOT_IMSG_FD_CHILD + 1) == -1) {
-		fprintf(stderr, "%s: %s\n", getprogname(), strerror(errno));
-		_exit(1);
-	}
+
+	closefrom(GOT_IMSG_FD_CHILD + 1);
 
 	if (execl(path, path, repo_path, (char *)NULL) == -1) {
 		fprintf(stderr, "%s: %s: %s\n", getprogname(), path,
-- 
2.34.1