# HG changeset patch # User Luke Schierer # Date 1082316393 0 # Node ID 581c943489840a8605611278467609cb3e03e4ff # Parent 5779e1beef8dccc7a33aefd15ecdd640c638f95a [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 diff -r 5779e1beef8d -r 581c94348984 plugins/gaim-remote/remote.c --- 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);