Commit 8512efdf authored by Kirill Tkhai's avatar Kirill Tkhai Committed by Andrei Vagin

files: Unify clone_service_fd()

Make this function more generic: we want to do not dup not only
transport socket of parent, but just all service fds, which
were not opened at the moment of clone() in parent. But,
yes, currently it's only transport socket.

travis-ci: success for files: Unify clone_service_fd()
Signed-off-by: 's avatarKirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent fce87893
......@@ -481,11 +481,10 @@ int clone_service_fd(int id)
return 0;
for (i = SERVICE_FD_MIN + 1; i < SERVICE_FD_MAX; i++) {
int old = __get_service_fd(i, service_fd_id);
int old = get_service_fd(i);
int new = __get_service_fd(i, id);
/* Do not dup parent's transport fd */
if (i == TRANSPORT_FD_OFF)
if (old < 0)
continue;
ret = dup2(old, new);
if (ret == -1) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment