comparison plugins/gaim-remote/remote.c @ 10462:f7b32dd67bdf

[gaim-migrate @ 11735] Fix for bug 1027454: Blank "Unable to open socket" window if locale is not UTF-8 committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Fri, 31 Dec 2004 15:34:18 +0000
parents 3e4ecbdf8d0a
children 0f7452b1f777
comparison
equal deleted inserted replaced
10461:e94802fe3eaf 10462:f7b32dd67bdf
743 g_snprintf(saddr.sun_path, sizeof(saddr.sun_path), "%s" G_DIR_SEPARATOR_S "gaim_%s.%d", 743 g_snprintf(saddr.sun_path, sizeof(saddr.sun_path), "%s" G_DIR_SEPARATOR_S "gaim_%s.%d",
744 g_get_tmp_dir(), g_get_user_name(), gaim_session); 744 g_get_tmp_dir(), g_get_user_name(), gaim_session);
745 if (bind(fd, (struct sockaddr *)&saddr, sizeof(saddr)) != -1) 745 if (bind(fd, (struct sockaddr *)&saddr, sizeof(saddr)) != -1)
746 listen(fd, 100); 746 listen(fd, 100);
747 else { 747 else {
748 char *tmp = g_locale_to_utf8(strerror(errno), -1, NULL, NULL, NULL);
748 *error = g_strdup_printf(_("Failed to assign %s to a socket:\n%s"), 749 *error = g_strdup_printf(_("Failed to assign %s to a socket:\n%s"),
749 saddr.sun_path, strerror(errno)); 750 saddr.sun_path, tmp);
750 g_log(NULL, G_LOG_LEVEL_CRITICAL, 751 g_log(NULL, G_LOG_LEVEL_CRITICAL,
751 "Failed to assign %s to a socket (Error: %s)", 752 "Failed to assign %s to a socket (Error: %s)",
752 saddr.sun_path, strerror(errno)); 753 saddr.sun_path, strerror(errno));
753 umask(m); 754 umask(m);
755 g_free(tmp);
754 return -1; 756 return -1;
755 } 757 }
756 umask(m); 758 umask(m);
757 } else 759 } else
758 g_log(NULL, G_LOG_LEVEL_CRITICAL, "Unable to open socket: %s", strerror(errno)); 760 g_log(NULL, G_LOG_LEVEL_CRITICAL, "Unable to open socket: %s", strerror(errno));