This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[incremental] Patch: FYI: handling linking


I'm checking this in on the incremental-compiler branch.

If you compile and link using a single invocation of gcc, it will
fail.  This happens because we try to send the 'collect2' command to
the running server -- which is wrong.

This patch fixes the problem.

Tom

ChangeLog:
2008-01-29  Tom Tromey  <tromey@redhat.com>

	* server.c (forget_socket_name): New function.
	(send_command_and_wait): Close connection.

Index: server.c
===================================================================
--- server.c	(revision 131644)
+++ server.c	(working copy)
@@ -105,6 +105,17 @@
   return server_socket_name;
 }
 
+/* If we computed a socket name, forget about it now.  */
+static void
+forget_socket_name (void)
+{
+  if (server_socket_name)
+    {
+      free (server_socket_name);
+      server_socket_name = NULL;
+    }
+}
+
 /* If SOCKET is not -1, close the server socket.  Unlink the server
    socket and its directory as well.  */
 static void
@@ -612,6 +623,10 @@
   if (interrupted)
     raise (SIGINT);
 
+  close (connection_fd);
+  connection_fd = -1;
+  forget_socket_name ();
+
   return status ? false : true;
 }
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]