Date: Fri, 27 Aug 2021 12:48:44 GMT From: Mark Johnston <markj@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 091869def9ee - main - connect: Use soconnectat() unconditionally in kern_connect() Message-ID: <202108271248.17RCmiP7060365@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=091869def9eeb9796c3627ea95bf6cc46cf952a0 commit 091869def9eeb9796c3627ea95bf6cc46cf952a0 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2021-08-27 12:32:07 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2021-08-27 12:32:07 +0000 connect: Use soconnectat() unconditionally in kern_connect() soconnect(...) is equivalent to soconnectat(AT_FDCWD, ...), so rely on this to save a branch. No functional change intended. MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/kern/uipc_syscalls.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 18505b54d603..3208dc0491dd 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -511,10 +511,7 @@ kern_connectat(struct thread *td, int dirfd, int fd, struct sockaddr *sa) if (error != 0) goto bad; #endif - if (dirfd == AT_FDCWD) - error = soconnect(so, sa, td); - else - error = soconnectat(dirfd, so, sa, td); + error = soconnectat(dirfd, so, sa, td); if (error != 0) goto bad; if ((so->so_state & SS_NBIO) && (so->so_state & SS_ISCONNECTING)) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202108271248.17RCmiP7060365>