Skip to content

Commit

Permalink
fix duplicate socket for linux
Browse files Browse the repository at this point in the history
  • Loading branch information
dec100 committed Oct 13, 2016
1 parent cd15b64 commit dd741a0
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions Rserve/src/Rserv.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,15 +384,6 @@ wfork(int socket, char* parentCmdLine, int idx)
}
dwCreationflags = GetPriorityClass (GetCurrentProcess ()) | CREATE_NEW_PROCESS_GROUP ;

//duplicate the socket handle
//if(!DuplicateHandle (GetCurrentProcess (), (HANDLE) socket,
// GetCurrentProcess (), (HANDLE *) &winSocks[idx],
// 0, TRUE, DUPLICATE_SAME_ACCESS))
//{
// rc = GetLastError ();
// return -1;
//}

winSocks[idx] = socket;
//create the command line
sprintf_s (buf, 128, "%d --ppid %d", socket, (int)GetCurrentProcessId());
Expand Down Expand Up @@ -3490,6 +3481,7 @@ int main(int argc, char **argv)
}
else
{
#ifdef WIN32
socket = atoi(argv[++i]);
WSAPROTOCOL_INFO pi;

Expand All @@ -3512,6 +3504,7 @@ int main(int argc, char **argv)
return -1;
}
socket = socket_duplicate;
#endif
}
}
if (!strcmp(argv[i]+2,"ppid")) {
Expand Down

0 comments on commit dd741a0

Please sign in to comment.