OSSP CVS Repository

ossp - Check-in [5973]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 5973
Date: 2007-Oct-12 21:57:56 (local)
2007-Oct-12 19:57:56 (UTC)
User:rse
Branch:
Comment: Fix example given under "MULTITHREADING ENVIRONMENTS" in the manual page. The problem is that the context can be still not associated and hence be NULL.

Submitted by: Frank Hempel <red_socks@gmx.de>

Tickets:
#158 pthread library from ex(3) manpage may cause another segfault
Inspections:
Files:
ossp-pkg/ex/ChangeLog      1.17 -> 1.18     4 inserted, 1 deleted
ossp-pkg/ex/THANKS      1.3 -> 1.4     1 inserted, 0 deleted
ossp-pkg/ex/ex.pod      1.32 -> 1.33     9 inserted, 2 deleted

ossp-pkg/ex/ChangeLog 1.17 -> 1.18

--- ChangeLog    2007/10/12 19:54:21     1.17
+++ ChangeLog    2007/10/12 19:57:56     1.18
@@ -13,7 +13,10 @@
 
   Changes between 1.0.5 and 1.0.6 (02-Oct-2005 to XX-xxx-2006)
 
-   *) ...
+   *) Fix example given under "MULTITHREADING ENVIRONMENTS"
+      in the manual page. The problem is that the context
+      can be still not associated and hence be NULL.
+      [Frank Hempel <red_socks@gmx.de>]
 
    *) Upgrade build environment to GNU shtool 2.0.7,
       GNU libtool 1.5.24 and GNU autoconf 2.61.


ossp-pkg/ex/THANKS 1.3 -> 1.4

--- THANKS       2003/01/30 11:02:38     1.3
+++ THANKS       2007/10/12 19:57:56     1.4
@@ -13,6 +13,7 @@
   bugfixes, hints, gave platform feedback, etc. (in alphabetical order):
 
   Michael van Elst    <mlelstv@dev.de.cw.net>
+  Frank Hempel        <red_socks@gmx.de>
   Thomas Lotterer     <thomas@lotterer.net>
   A Makarov           <makarov@tecon.ru>
   Michael Schloh      <michael@schloh.com>


ossp-pkg/ex/ex.pod 1.32 -> 1.33

--- ex.pod       2006/08/10 19:49:33     1.32
+++ ex.pod       2007/10/12 19:57:56     1.33
@@ -598,13 +598,20 @@
  /* callback: context fetching */
  static ex_ctx_t *pthread_ex_ctx(void)
  {
-     return (ex_ctx_t *)
-         pthread_getspecific(pthread_ex_ctx_key);
+     ex_ctx_t *ctx;
+
+     if ((ctx = (ex_ctx_t *)pthread_getspecific(pthread_ex_ctx_key)) == NULL)
+         return __ex_ctx_default();
+     return ctx;
  }
 
  /* callback: termination */
  static void pthread_ex_terminate(ex_t *e)
  {
+     ex_ctx_t *ctx;
+
+     if ((ctx = (ex_ctx_t *)pthread_getspecific(pthread_ex_ctx_key)) == NULL)
+         __ex_terminate_default(e);
      pthread_exit(e->ex_value);
  }
 

CVSTrac 2.0.1