diff options
| author | Brent Cook <busterb@gmail.com> | 2025-10-07 03:07:42 -0500 |
|---|---|---|
| committer | Brent Cook <busterb@gmail.com> | 2025-10-07 03:07:42 -0500 |
| commit | 7a841ee9732656e2db6679c85a0853108fbefe45 (patch) | |
| tree | 653d081e2844b6273577e4817031864ba0dc90c5 | |
| parent | 3821bc6d3822e38ca4fc05eeaac5416edd11ffda (diff) | |
| parent | d7a9ca6d2ffdfd65543c32b6f11a8a106e839d81 (diff) | |
| download | portable-7a841ee9732656e2db6679c85a0853108fbefe45.tar.gz portable-7a841ee9732656e2db6679c85a0853108fbefe45.tar.bz2 portable-7a841ee9732656e2db6679c85a0853108fbefe45.zip | |
Land #1198, Fix inconsistencies in accept4.c
| -rw-r--r-- | apps/nc/compat/accept4.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/nc/compat/accept4.c b/apps/nc/compat/accept4.c index 278198b..dca42e9 100644 --- a/apps/nc/compat/accept4.c +++ b/apps/nc/compat/accept4.c | |||
| @@ -6,10 +6,10 @@ accept4(int s, struct sockaddr *addr, socklen_t *addrlen, int flags) | |||
| 6 | { | 6 | { |
| 7 | int rets = accept(s, addr, addrlen); | 7 | int rets = accept(s, addr, addrlen); |
| 8 | if (rets == -1) | 8 | if (rets == -1) |
| 9 | return s; | 9 | return rets; |
| 10 | 10 | ||
| 11 | if (flags & SOCK_CLOEXEC) { | 11 | if (flags & SOCK_CLOEXEC) { |
| 12 | flags = fcntl(s, F_GETFD); | 12 | flags = fcntl(rets, F_GETFD); |
| 13 | fcntl(rets, F_SETFD, flags | FD_CLOEXEC); | 13 | fcntl(rets, F_SETFD, flags | FD_CLOEXEC); |
| 14 | } | 14 | } |
| 15 | 15 | ||
