Mercurial > pidgin
diff console/libgnt/gntmain.c @ 14881:5228f8cf2a6a
[gaim-migrate @ 17650]
Print a debug message if someone tries to specify a binding for some non-existent action.
Make sure the conversation windows aren't too large to cause a crash.
raise(SIGABRT) instead of exit() to force a coredump if something goes wrong with stdin.
committer: Tailor Script <tailor@pidgin.im>
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Wed, 01 Nov 2006 20:59:23 +0000 |
parents | 70623f0d5cdc |
children | 065e7ac30338 |
line wrap: on
line diff
--- a/console/libgnt/gntmain.c Wed Nov 01 19:23:39 2006 +0000 +++ b/console/libgnt/gntmain.c Wed Nov 01 20:59:23 2006 +0000 @@ -774,16 +774,17 @@ int rd = read(STDIN_FILENO, keys, sizeof(keys) - 1); if (rd < 0) { + int ch = getch(); /* This should return ERR, but let's see what it really returns */ endwin(); printf("ERROR: %s\n", strerror(errno)); - printf("File descriptor is: %d\n\nGIOChannel is: %p", STDIN_FILENO, source); - exit(1); + printf("File descriptor is: %d\n\nGIOChannel is: %p\ngetch() = %d\n", STDIN_FILENO, source, ch); + raise(SIGABRT); } else if (rd == 0) { endwin(); printf("EOF\n"); - exit(1); + raise(SIGABRT); } event_stack = TRUE; @@ -1115,11 +1116,11 @@ (G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_PRI | G_IO_NVAL), io_invoke, NULL, NULL); - locale = setlocale(LC_ALL, ""); + g_io_channel_unref(channel); /* Apparently this caused crashes for some people. + But irssi does this, so I am going to assume the + crashes were caused by some other stuff. */ -#if 0 - g_io_channel_unref(channel); /* Apparently this causes crash for some people */ -#endif + locale = setlocale(LC_ALL, ""); if (locale && (strstr(locale, "UTF") || strstr(locale, "utf"))) ascii_only = FALSE;