Index: functions.c
===================================================================
--- functions.c	(revision 83e023e9db86cd6fb930db4e4594001ffb565613)
+++ functions.c	(revision 4ebbfbc5360fa004637dd101f5a0c833cdccd60a)
@@ -1223,4 +1223,5 @@
 void G_GNUC_PRINTF(1, 2) owl_function_debugmsg(const char *fmt, ...)
 {
+  char *tmpbuff;
   FILE *file;
   time_t now;
@@ -1237,6 +1238,8 @@
   now = time(NULL);
 
-  fprintf(file, "[%d -  %.24s - %lds]: ",
-	  (int) getpid(), ctime(&now), now - owl_global_get_starttime(&g));
+  tmpbuff = owl_util_time_to_timestr(localtime(&now));
+  fprintf(file, "[%d -  %s - %lds]: ",
+          (int) getpid(), tmpbuff, now - owl_global_get_starttime(&g));
+  g_free(tmpbuff);
   vfprintf(file, fmt, ap);
   putc('\n', file);
@@ -1761,4 +1764,5 @@
 void owl_function_status(void)
 {
+  char *tmpbuff;
   char buff[MAXPATHLEN+1];
   time_t start;
@@ -1788,5 +1792,7 @@
   owl_fmtext_append_normal(&fm, "\n");
 
-  owl_fmtext_appendf_normal(&fm, "  Startup Time: %s", ctime(&start));
+  tmpbuff = owl_util_time_to_timestr(localtime(&start));
+  owl_fmtext_appendf_normal(&fm, "  Startup Time: %s\n", tmpbuff);
+  g_free(tmpbuff);
 
   up=owl_global_get_runtime(&g);
@@ -3410,7 +3416,6 @@
   char *buff;
 
-  now=time(NULL);
-  date=g_strdup(ctime(&now));
-  date[strlen(date)-1]='\0';
+  now = time(NULL);
+  date = owl_util_time_to_timestr(localtime(&now));
 
   buff = g_strdup_printf("%s %s", date, string);
Index: message.c
===================================================================
--- message.c	(revision 6500907f6e410b9b8ffb57962f97795ebeb0ccd5)
+++ message.c	(revision 4ebbfbc5360fa004637dd101f5a0c833cdccd60a)
@@ -46,7 +46,6 @@
   
   /* save the time */
-  m->time=time(NULL);
-  m->timestr=g_strdup(ctime(&(m->time)));
-  m->timestr[strlen(m->timestr)-1]='\0';
+  m->time = time(NULL);
+  m->timestr = owl_util_time_to_timestr(localtime(&m->time));
 
   m->fmtext = NULL;
@@ -796,7 +795,6 @@
   /* save the time, we need to nuke the string saved by message_init */
   if (m->timestr) g_free(m->timestr);
-  m->time=n->z_time.tv_sec;
-  m->timestr=g_strdup(ctime(&(m->time)));
-  m->timestr[strlen(m->timestr)-1]='\0';
+  m->time = n->z_time.tv_sec;
+  m->timestr = owl_util_time_to_timestr(localtime(&m->time));
 
   /* set other info */
Index: owl.c
===================================================================
--- owl.c	(revision b8a3e0025038d7a71f4d13206b772d904f95b8a0)
+++ owl.c	(revision a7fac140d17626bc37808cae6b389f3240135903)
@@ -389,7 +389,7 @@
 }
 
-#define CHECK_RESULT(s, syscall) \
+#define OR_DIE(s, syscall)       \
   G_STMT_START {		 \
-    if ((syscall) != 0) {	 \
+    if ((syscall) == -1) {	 \
       perror((s));		 \
       exit(1);			 \
@@ -402,28 +402,28 @@
   sigset_t sigset;
   int ret, i;
-  const int signals[] = { SIGABRT, SIGBUS, SIGCHLD, SIGFPE, SIGHUP, SIGILL,
-                          SIGINT, SIGQUIT, SIGSEGV, SIGTERM, SIGWINCH };
+  const int reset_signals[] = { SIGABRT, SIGBUS, SIGCHLD, SIGFPE, SIGILL,
+                                SIGQUIT, SIGSEGV, };
+  /* Don't bother resetting watched ones because owl_signal_init will. */
+  const int watch_signals[] = { SIGWINCH, SIGTERM, SIGHUP, SIGINT, };
 
   /* Sanitize our signals; the mask and dispositions from our parent
    * aren't really useful. Signal list taken from equivalent code in
    * Chromium. */
-  CHECK_RESULT("sigemptyset", sigemptyset(&sigset));
+  OR_DIE("sigemptyset", sigemptyset(&sigset));
   if ((ret = pthread_sigmask(SIG_SETMASK, &sigset, NULL)) != 0) {
     errno = ret;
     perror("pthread_sigmask");
-  }
-  for (i = 0; i < G_N_ELEMENTS(signals); i++) {
-    CHECK_RESULT("sigaction", sigaction(signals[i], &sig_default, NULL));
+    exit(1);
+  }
+  for (i = 0; i < G_N_ELEMENTS(reset_signals); i++) {
+    OR_DIE("sigaction", sigaction(reset_signals[i], &sig_default, NULL));
   }
 
   /* Turn off SIGPIPE; we check the return value of write. */
-  CHECK_RESULT("sigaction", sigaction(SIGPIPE, &sig_ignore, NULL));
+  OR_DIE("sigaction", sigaction(SIGPIPE, &sig_ignore, NULL));
 
   /* Register some signals with the signal thread. */
-  CHECK_RESULT("sigaddset", sigaddset(&sigset, SIGWINCH));
-  CHECK_RESULT("sigaddset", sigaddset(&sigset, SIGTERM));
-  CHECK_RESULT("sigaddset", sigaddset(&sigset, SIGHUP));
-  CHECK_RESULT("sigaddset", sigaddset(&sigset, SIGINT));
-  owl_signal_init(&sigset, sig_handler, NULL);
+  owl_signal_init(watch_signals, G_N_ELEMENTS(watch_signals),
+                  sig_handler, NULL);
 }
 
Index: perl/modules/Twitter/lib/BarnOwl/Module/Twitter/Handle.pm
===================================================================
--- perl/modules/Twitter/lib/BarnOwl/Module/Twitter/Handle.pm	(revision 7aa1fa5641d99c7c3fc1a998a0b98cd8e7f3d5f4)
+++ perl/modules/Twitter/lib/BarnOwl/Module/Twitter/Handle.pm	(revision 4ebbfbc5360fa004637dd101f5a0c833cdccd60a)
@@ -29,5 +29,5 @@
 use BarnOwl;
 use BarnOwl::Message::Twitter;
-use POSIX qw(asctime);
+use POSIX qw(strftime);
 
 use LWP::UserAgent;
@@ -247,5 +247,5 @@
                        ($self->{cfg}->{account_nickname} ?
                         "[$self->{cfg}->{account_nickname}]" : "") .
-                        ": ratelimited until " . asctime(localtime($timeout)));
+                        ": ratelimited until " . strftime('%c', localtime($timeout)));
     } elsif(exists($ratelimit->{error})) {
         $self->sleep(60*20);
Index: signal.c
===================================================================
--- signal.c	(revision 1d21d9fd6efdecb79b0bef96aabee3943d6a955a)
+++ signal.c	(revision a7fac140d17626bc37808cae6b389f3240135903)
@@ -1,3 +1,4 @@
 #include <errno.h>
+#include <glib.h>
 #include <pthread.h>
 #include <signal.h>
@@ -13,5 +14,19 @@
 static void *signal_thread_func(void *data);
 
-/* Initializes the signal thread to listen for 'set' on a dedicated
+static void dummy_handler(int signum)
+{
+  /* Do nothing. This should never get called. It'd be nice to report the error
+   * or something, but you can't have nice things in a signal handler. */
+}
+
+#define OR_DIE(s, syscall)       \
+  G_STMT_START {		 \
+    if ((syscall) == -1) {	 \
+      perror((s));		 \
+      exit(1);			 \
+    }				 \
+  } G_STMT_END
+
+/* Initializes the signal thread to listen for 'signals' on a dedicated
  * thread. 'callback' is called *on the signal thread* when a signal
  * is received.
@@ -19,14 +34,27 @@
  * This function /must/ be called before any other threads are
  * created. (Otherwise the signals will not get blocked correctly.) */
-void owl_signal_init(const sigset_t *set, void (*callback)(const siginfo_t*, void*), void *data) {
+void owl_signal_init(const int *signals, int num_signals, void (*callback)(const siginfo_t*, void*), void *data) {
+  struct sigaction sig_dummy = { .sa_handler = dummy_handler };
   int ret;
+  int i;
 
-  signal_set = *set;
   signal_cb = callback;
   signal_cbdata = data;
+
+  /* Stuff the signals into our sigset_t. Also assign all of them to a dummy
+   * handler. Otherwise, if their default is SIG_IGN, they will get dropped if
+   * delivered while processing. On Solaris, they will not get delivered at
+   * all. */
+  OR_DIE("sigemptyset", sigemptyset(&signal_set));
+  for (i = 0; i < num_signals; i++) {
+    OR_DIE("sigaddset", sigaddset(&signal_set, signals[i]));
+    OR_DIE("sigaction", sigaction(signals[i], &sig_dummy, NULL));
+  }
+
   /* Block these signals in all threads, so we can get them. */
-  if ((ret = pthread_sigmask(SIG_BLOCK, set, NULL)) != 0) {
+  if ((ret = pthread_sigmask(SIG_BLOCK, &signal_set, NULL)) != 0) {
     errno = ret;
     perror("pthread_sigmask");
+    exit(1);
   }
   /* Spawn a dedicated thread to sigwait. */
Index: util.c
===================================================================
--- util.c	(revision 821937403dc7baff14367b7715f3a349787a4941)
+++ util.c	(revision 4ebbfbc5360fa004637dd101f5a0c833cdccd60a)
@@ -296,4 +296,17 @@
 }
 
+CALLER_OWN char *owl_util_time_to_timestr(const struct tm *time)
+{
+  /* 32 chosen for first attempt because timestr will end up being
+   * something like "Www Mmm dd hh:mm:ss AM yyyy UTC\0" */ 
+  size_t timestr_size = 16;
+  char *timestr = NULL;
+  do {
+    timestr_size *= 2;
+    timestr = g_renew(char, timestr, timestr_size);
+  } while (strftime(timestr, timestr_size, "%c", time) == 0);
+  return timestr;
+}
+
 /* These are in order of their value in owl.h */
 static const struct {
