Index: trunk/src/sh_unix.c
===================================================================
--- trunk/src/sh_unix.c	(revision 408)
+++ trunk/src/sh_unix.c	(revision 409)
@@ -5398,7 +5398,10 @@
  */
 #if defined(SCREW_IT_UP)
-volatile int sh_not_traced = 0;
-
+struct screw_it_up {
+  int not_traced;
 #ifdef HAVE_GETTIMEOFDAY
+  struct timeval save_tv;
+#endif
+};
 
 #if defined(HAVE_PTHREAD)
@@ -5412,8 +5415,8 @@
 }
 
-static inline struct timeval * sh_get_save_tv()
+static inline struct screw_it_up * sh_get_screw_it_up()
 {
   void * ptr;
-  struct timeval * save_tv;
+  struct screw_it_up * screw;
 
   (void) pthread_once(&gSaveTv_key_once, make_gSaveTv_key);
@@ -5421,8 +5424,8 @@
   if ((ptr = pthread_getspecific(gSaveTv_key)) == NULL) 
     {
-      ptr = malloc(sizeof(struct timeval));
+      ptr = malloc(sizeof(struct screw_it_up));
       if (ptr)
 	{
-	  save_tv  = (struct timeval*) ptr;
+	  screw = (struct screw_it_up *) ptr;
 	  (void) pthread_setspecific(gSaveTv_key, ptr);
 	}
@@ -5434,22 +5437,46 @@
   else 
     {
-      save_tv  = (struct timeval*) ptr;
-    }
-  return save_tv;
-}
-
+      screw = (struct screw_it_up *) ptr;
+    }
+  return screw;
+}
+
+#ifdef HAVE_GETTIMEOFDAY
 void sh_set_save_tv()
 {
-  struct timeval * save_tv = sh_get_save_tv();
+  struct screw_it_up * screw = sh_get_screw_it_up();
+  struct timeval * save_tv = &(screw->save_tv);
   if (save_tv)
     gettimeofday(save_tv, NULL);
   return;
 }
+struct timeval * sh_get_save_tv()
+{
+  struct screw_it_up * screw = sh_get_screw_it_up();
+  struct timeval * save_tv = &(screw->save_tv);
+  return save_tv;
+}
+/* #ifdef HAVE_GETTIMEOFDAY */
+#endif
+
+void sh_set_untraced(int val)
+{
+  struct screw_it_up * screw = sh_get_screw_it_up();
+
+  screw->not_traced = val;
+  return;
+}
+int sh_get_untraced()
+{
+  struct screw_it_up * screw = sh_get_screw_it_up();
+
+  return screw->not_traced;
+}
 
 /* !defined(HAVE_PTHREAD) */
 #else
 
+#ifdef HAVE_GETTIMEOFDAY
 static struct timeval * sSaveTv = NULL;
-
 static inline struct timeval * sh_get_save_tv()
 {
@@ -5460,8 +5487,20 @@
   gettimeofday(sSaveTv, NULL);
 }
-#endif
-
 /* #ifdef HAVE_GETTIMEOFDAY */
 #endif
+
+volatile int sh_not_traced = 0;
+void sh_set_untraced(int val)
+{
+  sh_not_traced = val;
+  return;
+}
+int sh_get_untraced()
+{
+  return sh_not_traced;
+}
+
+#endif
+
 
 void sh_sigtrap_handler (int signum)
@@ -5479,5 +5518,5 @@
     raise(SIGKILL);
 #endif
-  sh_not_traced += signum;
+  sh_set_untraced(signum);
   return;
 }
