Skip to content

Commit e6695dd

Browse files
committed
Use SOCK_CLOEXEC instead of setting O_CLOEXEC manually
No other functional change intended.
1 parent 3d658cc commit e6695dd

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

agent/qrexec-fork-server.c

-4
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,6 @@ int main(int argc, char **argv) {
124124
}
125125

126126
s = get_server_socket(socket_path);
127-
if (fcntl(s, F_SETFD, O_CLOEXEC) < 0) {
128-
PERROR("fcntl");
129-
exit(1);
130-
}
131127
/* fork into background */
132128
switch (fork()) {
133129
case -1:

libqrexec/unix-server.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ int get_server_socket(const char *socket_address)
3636

3737
unlink(socket_address);
3838

39-
s = socket(AF_UNIX, SOCK_STREAM, 0);
39+
s = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
4040
if (s < 0) {
4141
PERROR("socket");
4242
exit(1);

0 commit comments

Comments
 (0)