changeset 3533:6c32036050cf

[gaim-migrate @ 3607] An automake fix, and a fix for an incredibly blatant Linuxism. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Wed, 18 Sep 2002 00:11:45 +0000
parents 369d419c8a29
children ea6d6e6463a5
files src/Makefile.am src/aim.c src/core.c src/gaim-remote.c
diffstat 4 files changed, 4 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/src/Makefile.am	Tue Sep 17 16:44:00 2002 +0000
+++ b/src/Makefile.am	Wed Sep 18 00:11:45 2002 +0000
@@ -32,6 +32,7 @@
 gaim_LDFLAGS = -export-dynamic
 gaim_LDADD = @LDADD@ @LIBOBJS@
 
+gaim_LDADD = @LDADD@ @LIBOBJS@
 gaim_remote_SOURCES = gaim-remote.c socket.c
 
 CFLAGS += $(PERL_CFLAGS)
--- a/src/aim.c	Tue Sep 17 16:44:00 2002 +0000
+++ b/src/aim.c	Wed Sep 18 00:11:45 2002 +0000
@@ -481,25 +481,6 @@
 	return TRUE;
 }
 
-static int open_socket(char *name)
-{
-	struct sockaddr_un saddr;
-	gint fd;
-
-	if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) != -1) {
-		saddr.sun_family = AF_UNIX;
-		g_snprintf(saddr.sun_path, 108, "%s", name);
-		if (connect(fd, (struct sockaddr *)&saddr, sizeof(saddr)) != -1)
-			return fd;
-		else
-			debug_printf("Failed to assign %s to a socket (Error: %s)\n",
-					saddr.sun_path, strerror(errno));
-	} else
-		debug_printf("Unable to open socket: %s\n", strerror(errno));
-	close(fd);
-	return -1;
-}
-
 static int ui_main()
 {
 	GIOChannel *channel;
@@ -520,7 +501,7 @@
 
 	g_snprintf(name, sizeof(name), "%s/gaim_%s.%d", g_get_tmp_dir(), g_get_user_name(), gaim_session);
 
-	UI_fd = open_socket(name);
+	UI_fd = gaim_connect_to_session(0);
 	if (UI_fd < 0)
 		return 1;
 
--- a/src/core.c	Tue Sep 17 16:44:00 2002 +0000
+++ b/src/core.c	Wed Sep 18 00:11:45 2002 +0000
@@ -443,7 +443,7 @@
 	if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) != -1) {
 		mode_t m = umask(0177);
 		saddr.sun_family = AF_UNIX;
-		g_snprintf(saddr.sun_path, 108, "%s/gaim_%s.%d",
+		g_snprintf(saddr.sun_path, sizeof(saddr.sun_path), "%s/gaim_%s.%d",
 			   g_get_tmp_dir(), g_get_user_name(), gaim_session);
 		if (bind(fd, (struct sockaddr *)&saddr, sizeof(saddr)) != -1)
 			listen(fd, 100);
--- a/src/gaim-remote.c	Tue Sep 17 16:44:00 2002 +0000
+++ b/src/gaim-remote.c	Wed Sep 18 00:11:45 2002 +0000
@@ -20,7 +20,7 @@
  */
 
 #include "gaim.h"
-#include "getopt.h"
+#include <getopt.h>
 #include "gaim-socket.h"
 
 void show_remote_usage(char *name)