On Wed, Dec 20, 2017 at 07:07:16PM +0300, Stanislav Kinsburskiy wrote: > Usernsd closes socket when sent. > > https://jira.sw.ru/browse/PSBM-79462 > > Signed-off-by: Stanislav Kinsburskiy <skinsbur...@virtuozzo.com> > --- > criu/spfs.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/criu/spfs.c b/criu/spfs.c > index da19179..857a167 100644 > --- a/criu/spfs.c > +++ b/criu/spfs.c > @@ -162,11 +162,19 @@ static int start_spfs_manager(void) > static int get_spfs_mngr_sock(void *start, int fd, pid_t pid) > { > int sock; > + int sfd; > > sock = get_service_fd(SPFS_MNGR_SK); > if (sock < 0 && start) > sock = start_spfs_manager(); > - return sock; > + if (sock < 0) > + return sock; > +
start_spfs_manager() returns a descriptor which has to be closed. You need to dup a descriptor, only if it is a service one. > + sfd = dup(sock); > + if (sfd < 0) > + pr_perror("failed to duplicate socket %d", sock); > + > + return sfd; > } > > static int request_spfs_mngr_sock(bool *start_mngr) > _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel