Re: [Libevent-users] [PATCH] signal.c: debug cleanups

2007-11-13 Thread Niels Provos
Thank you.  Applied to trunk and branch.

Niels

On Nov 10, 2007 5:46 PM, Christopher Layne [EMAIL PROTECTED] wrote:
 1. Fix a debugging call with wrong format, (we should probably use
 __attr__((format(printf))) eventually).
 2. Add additional debugging calls for sanity.

 -cl

 Index: signal.c
 ===
 --- signal.c(revision 507)
 +++ signal.c(working copy)
 @@ -141,7 +141,7 @@
  * a dynamic array is used to keep footprint on the low side.
  */
 if (evsignal = sig-sh_old_max) {
 -   event_debug((%s: evsignal  sh_old_max, resizing array,
 +   event_debug((%s: evsignal (%d) = sh_old_max (%d), resizing,
 __func__, evsignal, sig-sh_old_max));
 sig-sh_old_max = evsignal + 1;
 p = realloc(sig-sh_old, sig-sh_old_max * sizeof 
 *sig-sh_old);
 @@ -159,8 +159,9 @@
 return (-1);
 }

 +   /* setup new handler */
 +   event_debug((%s: %p: changing signal handler, __func__, ev));
  #ifdef HAVE_SIGACTION
 -   /* setup new handler */
 memset(sa, 0, sizeof(sa));
 sa.sa_handler = evsignal_handler;
 sa.sa_flags |= SA_RESTART;
 @@ -207,6 +208,7 @@
 evsignal = EVENT_SIGNAL(ev);

 /* restore previous handler */
 +   event_debug((%s: %p: restoring signal handler, __func__, ev));
 sh = sig-sh_old[evsignal];
 sig-sh_old[evsignal] = NULL;
  #ifdef HAVE_SIGACTION

 ___
 Libevent-users mailing list
 Libevent-users@monkey.org
 http://monkeymail.org/mailman/listinfo/libevent-users


___
Libevent-users mailing list
Libevent-users@monkey.org
http://monkeymail.org/mailman/listinfo/libevent-users


[Libevent-users] [PATCH] signal.c: debug cleanups

2007-11-10 Thread Christopher Layne
1. Fix a debugging call with wrong format, (we should probably use
__attr__((format(printf))) eventually).
2. Add additional debugging calls for sanity.

-cl

Index: signal.c
===
--- signal.c(revision 507)
+++ signal.c(working copy)
@@ -141,7 +141,7 @@
 * a dynamic array is used to keep footprint on the low side.
 */
if (evsignal = sig-sh_old_max) {
-   event_debug((%s: evsignal  sh_old_max, resizing array,
+   event_debug((%s: evsignal (%d) = sh_old_max (%d), resizing,
__func__, evsignal, sig-sh_old_max));
sig-sh_old_max = evsignal + 1;
p = realloc(sig-sh_old, sig-sh_old_max * sizeof *sig-sh_old);
@@ -159,8 +159,9 @@
return (-1);
}

+   /* setup new handler */
+   event_debug((%s: %p: changing signal handler, __func__, ev));
 #ifdef HAVE_SIGACTION
-   /* setup new handler */
memset(sa, 0, sizeof(sa));
sa.sa_handler = evsignal_handler;
sa.sa_flags |= SA_RESTART;
@@ -207,6 +208,7 @@
evsignal = EVENT_SIGNAL(ev);

/* restore previous handler */
+   event_debug((%s: %p: restoring signal handler, __func__, ev));
sh = sig-sh_old[evsignal];
sig-sh_old[evsignal] = NULL;
 #ifdef HAVE_SIGACTION

___
Libevent-users mailing list
Libevent-users@monkey.org
http://monkeymail.org/mailman/listinfo/libevent-users