summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Black <dragonheart@gentoo.org>2005-11-25 08:36:08 +0000
committerDaniel Black <dragonheart@gentoo.org>2005-11-25 08:36:08 +0000
commit9166c31df0a3b72cb9101675b49ab574edf36729 (patch)
treeff51d6878cad1f9f7531b86edb4d582777afc60b /app-admin/conky/files
parentdetermine kernel version from running version rather than /usr/src/linux - bu... (diff)
downloadgentoo-2-9166c31df0a3b72cb9101675b49ab574edf36729.tar.gz
gentoo-2-9166c31df0a3b72cb9101675b49ab574edf36729.tar.bz2
gentoo-2-9166c31df0a3b72cb9101675b49ab574edf36729.zip
fixes killed with ctrl+c from a terminal and gets glibc errors - bug #113219
(Portage version: 2.0.53_rc7)
Diffstat (limited to 'app-admin/conky/files')
-rw-r--r--app-admin/conky/files/conky-1.3.4-miscbug.patch127
-rw-r--r--app-admin/conky/files/digest-conky-1.3.4-r1 (renamed from app-admin/conky/files/digest-conky-1.3.4)0
2 files changed, 127 insertions, 0 deletions
diff --git a/app-admin/conky/files/conky-1.3.4-miscbug.patch b/app-admin/conky/files/conky-1.3.4-miscbug.patch
new file mode 100644
index 000000000000..815ba386c1f4
--- /dev/null
+++ b/app-admin/conky/files/conky-1.3.4-miscbug.patch
@@ -0,0 +1,127 @@
+--- src/conky.h.old 2005-11-16 18:45:32.000000000 -0500
++++ src/conky.h 2005-11-24 23:06:25.046033576 -0500
+@@ -209,8 +209,8 @@
+
+ int use_spacer;
+
+-char *tmpstring1;
+-char *tmpstring2;
++char tmpstring1[TEXT_BUFFER_SIZE];
++char tmpstring2[TEXT_BUFFER_SIZE];
+
+ #ifdef X11
+ /* in x11.c */
+--- src/conky.c.old 2005-11-16 19:32:39.000000000 -0500
++++ src/conky.c 2005-11-24 23:03:03.675646528 -0500
+@@ -3,7 +3,7 @@
+ *
+ * This program is licensed under BSD license, read COPYING
+ *
+- * $Id: conky-1.3.4-miscbug.patch,v 1.1 2005/11/25 08:36:08 dragonheart Exp $
++ * $Id: conky-1.3.4-miscbug.patch,v 1.1 2005/11/25 08:36:08 dragonheart Exp $
+ */
+
+ #include "conky.h"
+@@ -34,6 +34,9 @@
+ #define MAIL_FILE "$MAIL"
+ #define MAX_IF_BLOCK_DEPTH 5
+
++/* #define SIGNAL_BLOCKING */
++#undef SIGNAL_BLOCKING
++
+ #ifdef X11
+
+ /* alignments */
+@@ -4060,6 +4063,15 @@
+
+ static void main_loop()
+ {
++#ifdef SIGNAL_BLOCKING
++ sigset_t newmask, oldmask;
++
++ sigemptyset(&newmask);
++ sigaddset(&newmask,SIGINT);
++ sigaddset(&newmask,SIGTERM);
++ sigaddset(&newmask,SIGUSR1);
++#endif
++
+ #ifdef X11
+ Region region = XCreateRegion();
+ #endif /* X11 */
+@@ -4067,6 +4079,13 @@
+ info.looped = 0;
+ while (total_run_times == 0 || info.looped < total_run_times - 1) {
+ info.looped++;
++
++#ifdef SIGNAL_BLOCKING
++ /* block signals. we will inspect for pending signals later */
++ if (sigprocmask(SIG_BLOCK, &newmask, &oldmask) < 0)
++ CRIT_ERR("unable to sigprocmask()");
++#endif
++
+ #ifdef X11
+ XFlush(display);
+
+@@ -4287,7 +4306,12 @@
+ }
+ #endif /* X11 */
+
+- /* inspect pending signal prior to entering next loop */
++#ifdef SIGNAL_BLOCKING
++ /* unblock signals of interest and let handler fly */
++ if (sigprocmask(SIG_SETMASK, &oldmask, NULL) < 0)
++ CRIT_ERR("unable to sigprocmask()");
++#endif
++
+ switch(g_signal_pending) {
+ case SIGUSR1:
+ {
+@@ -4964,6 +4988,8 @@
+
+ int main(int argc, char **argv)
+ {
++ struct sigaction act, oact;
++
+ g_signal_pending=0;
+ memset(&info, 0, sizeof(info) );
+
+@@ -5058,11 +5084,6 @@
+ init_X11();
+ #endif /* X11 */
+
+- tmpstring1 = (char *)
+- malloc(TEXT_BUFFER_SIZE);
+- tmpstring2 = (char *)
+- malloc(TEXT_BUFFER_SIZE);
+-
+ /* load current_config or CONFIG_FILE */
+
+ #ifdef CONFIG_FILE
+@@ -5241,16 +5262,22 @@
+ }
+
+ /* Set signal handlers */
+- if ( signal(SIGINT,signal_handler) == SIG_ERR ||
+- signal(SIGUSR1,signal_handler) == SIG_ERR ||
+- signal(SIGTERM,signal_handler) == SIG_ERR )
++ act.sa_handler = signal_handler;
++ sigemptyset(&act.sa_mask);
++ act.sa_flags = 0;
++#ifdef SA_RESTART
++ act.sa_flags |= SA_RESTART;
++#endif
++
++ if ( sigaction(SIGINT,&act,&oact) < 0 ||
++ sigaction(SIGUSR1,&act,&oact) < 0 ||
++ sigaction(SIGTERM,&act,&oact) < 0 )
+ {
+ ERR("error setting signal handler: %s", strerror(errno) );
+ }
+
+ main_loop();
+- free(tmpstring1);
+- free(tmpstring2);
++
+ return 0;
+ }
+
diff --git a/app-admin/conky/files/digest-conky-1.3.4 b/app-admin/conky/files/digest-conky-1.3.4-r1
index 3d1c4064a29c..3d1c4064a29c 100644
--- a/app-admin/conky/files/digest-conky-1.3.4
+++ b/app-admin/conky/files/digest-conky-1.3.4-r1