If fork()ing, parent process must close child's socket fd. Child close() is not sufficient as both parent and child have a reference to the same socket fd, and fd will never be free'd if close() is not called from both processes.
This commit is contained in:
parent
71013a5a1b
commit
66c1144d4e
@ -302,6 +302,11 @@ int main(int argc, char* argv[]) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If parent, close reference to child's descriptor */
|
||||||
|
else if (CLOSE_SOCKET(connected_socket_fd) < 0) {
|
||||||
|
guac_log_error("Error closing daemon reference to child descriptor: %s", lasterror());
|
||||||
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
if (guac_thread_create(&thread, start_client_thread, (void*) data))
|
if (guac_thread_create(&thread, start_client_thread, (void*) data))
|
||||||
|
Loading…
Reference in New Issue
Block a user