Skip to content

Commit

Permalink
filter rresvport if not present -- @atupone (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
resuna authored May 30, 2023
1 parent 4a4663b commit 72c6c14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ int main(void) {
AC_CHECK_FUNC(inet_aton, , [AC_DEFINE(NO_INET_ATON)])
AC_CHECK_FUNC(gethostname, , [AC_DEFINE(NO_GETHOSTNAME)])
AC_CHECK_FUNCS([rresvport])
#-------------------------------------------------------------------------
# Check for additional libraries the Tcl/Tk does not check for.
Expand Down
2 changes: 2 additions & 0 deletions unix/tclXunixSock.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,14 @@ TclX_ServerCreateCmd (ClientData clientData,
/*
* Allocate a reserved port if requested.
*/
#ifdef HAVE_RRESVPORT
if (getReserved) {
int port;
if (rresvport (&port) < 0)
goto unixError;
local.sin_port = port;
}
#endif

/*
* Open a socket and bind an address and port to it.
Expand Down

0 comments on commit 72c6c14

Please sign in to comment.