changeset 8704:581c94348984

[gaim-migrate @ 9457] " Currently if a user attempts to load the remote control plugin but it can't assign the socket (often a result of an old socket in /tmp, possibly with incorrect permissions), the plugin will silently fail to load. This patch adds a bit of feedback so the user isn't left completely in the dark." --Stu Tomlinson this should thus make one faq entry obsolete, but given how some people don't upgrade, its best to leave it there for now. committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Sun, 18 Apr 2004 19:26:33 +0000
parents 5779e1beef8d
children 543b19a96ac5
files plugins/gaim-remote/remote.c
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/gaim-remote/remote.c	Sun Apr 18 19:23:01 2004 +0000
+++ b/plugins/gaim-remote/remote.c	Sun Apr 18 19:26:33 2004 +0000
@@ -35,6 +35,7 @@
 #include "core.h"
 #include "debug.h"
 #include "prpl.h"
+#include "notify.h"
 
 /* XXX */
 #include "gtkconv.h"
@@ -628,7 +629,7 @@
 }
 
 static gint
-open_socket()
+open_socket(char **error)
 {
 	struct sockaddr_un saddr;
 	gint fd;
@@ -647,6 +648,8 @@
 		if (bind(fd, (struct sockaddr *)&saddr, sizeof(saddr)) != -1)
 			listen(fd, 100);
 		else {
+			*error = g_strdup_printf(_("Failed to assign %s to a socket:\n%s"),
+					   saddr.sun_path, strerror(errno));
 			g_log(NULL, G_LOG_LEVEL_CRITICAL,
 			      "Failed to assign %s to a socket (Error: %s)",	
 			      saddr.sun_path, strerror(errno));
@@ -665,9 +668,13 @@
 {
 #ifndef _WIN32
 	GIOChannel *channel;
+	char *buf;
 
-	if ((UI_fd = open_socket()) < 0)
+	if ((UI_fd = open_socket(&buf)) < 0) {
+		gaim_notify_error(NULL, NULL, _("Unable to open socket"), buf);
+		g_free(buf);
 		return FALSE;
+	}
 
 	channel = g_io_channel_unix_new(UI_fd);
 	watcher = g_io_add_watch(channel, G_IO_IN, socket_readable, NULL);