]> git.cworth.org Git - ttt/blobdiff - src/ttt-socket.c
2005-11-11 Carl Worth <cworth@cworth.org>
[ttt] / src / ttt-socket.c
index 18577ffa378468088938985545f8d758507ee50a..f185d363780af7e5c43cb334f9e7ae42c52a258d 100644 (file)
@@ -146,11 +146,20 @@ ttt_socket_create_server (const char *host, const char *port)
 
 /* Exported: see ttt-socket.h for documentation. */
 void
 
 /* Exported: see ttt-socket.h for documentation. */
 void
-ttt_socket_accept (int listen_socket, ttt_socket_dispatch_func_t dispatch)
+ttt_socket_accept (int                          listen_socket,
+                  ttt_socket_accept_func_t      accept,
+                  void                         *closure)
 {
 {
+    pid_t pid;
     int connected_socket;
 
     connected_socket = _wait_for_connection (listen_socket);
 
     int connected_socket;
 
     connected_socket = _wait_for_connection (listen_socket);
 
-    (dispatch) (connected_socket);
+    pid = xfork();
+
+    if (pid == 0) {
+       /* Child process. */
+       (accept) (closure, connected_socket);
+       return;
+    }
 }
 }