socket-util: make return parameter to socket_autobind() optional
This commit is contained in:
@@ -1560,7 +1560,6 @@ int socket_autobind(int fd, char **ret_name) {
|
||||
* "autobind" feature, but uses 64-bit random number internally. */
|
||||
|
||||
assert(fd >= 0);
|
||||
assert(ret_name);
|
||||
|
||||
random = random_u64();
|
||||
|
||||
@@ -1577,7 +1576,8 @@ int socket_autobind(int fd, char **ret_name) {
|
||||
if (bind(fd, &sa.sa, r) < 0)
|
||||
return -errno;
|
||||
|
||||
*ret_name = TAKE_PTR(name);
|
||||
if (ret_name)
|
||||
*ret_name = TAKE_PTR(name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user