This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[incremental] Patch: FYI: handling linking
- From: Tom Tromey <tromey at redhat dot com>
- To: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 29 Jan 2008 12:28:42 -0700
- Subject: [incremental] Patch: FYI: handling linking
- Reply-to: Tom Tromey <tromey at redhat dot com>
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;
}