Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libpthread Consistently use pthread__assert() rather tha...
details: https://anonhg.NetBSD.org/src/rev/89f1f9b52626
branches: trunk
changeset: 545381:89f1f9b52626
user: nathanw <nathanw%NetBSD.org@localhost>
date: Mon Apr 07 19:41:22 2003 +0000
description:
Consistently use pthread__assert() rather than err() to assert that
timer_settime() worked, and don't bother calling err() after a
pthread__assert() call.
diffstat:
lib/libpthread/pthread_alarms.c | 14 ++++----------
1 files changed, 4 insertions(+), 10 deletions(-)
diffs (56 lines):
diff -r 045c7eb98cdb -r 89f1f9b52626 lib/libpthread/pthread_alarms.c
--- a/lib/libpthread/pthread_alarms.c Mon Apr 07 19:35:39 2003 +0000
+++ b/lib/libpthread/pthread_alarms.c Mon Apr 07 19:41:22 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pthread_alarms.c,v 1.7 2003/03/11 16:27:38 nathanw Exp $ */
+/* $NetBSD: pthread_alarms.c,v 1.8 2003/04/07 19:41:22 nathanw Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: pthread_alarms.c,v 1.7 2003/03/11 16:27:38 nathanw Exp $");
+__RCSID("$NetBSD: pthread_alarms.c,v 1.8 2003/04/07 19:41:22 nathanw Exp $");
#include <err.h>
#include <sys/time.h>
@@ -66,8 +66,7 @@
ev.sigev_signo = 0;
ev.sigev_value.sival_int = (int)PT_ALARMTIMER_MAGIC;
retval = timer_create(CLOCK_REALTIME, &ev, &pthread_alarmtimer);
- if (retval)
- err(1, "timer_create");
+ pthread__assert(retval == 0);
}
@@ -103,8 +102,7 @@
self, it.it_value.tv_sec, it.it_value.tv_nsec/1000));
retval = timer_settime(pthread_alarmtimer, TIMER_ABSTIME,
&it, NULL);
- if (retval)
- err(1, "timer_settime");
+ pthread__assert(retval == 0);
} else {
PTQ_INSERT_AFTER(&pthread_alarmqueue, prev, alarm, pta_next);
@@ -136,8 +134,6 @@
retval = timer_settime(pthread_alarmtimer, TIMER_ABSTIME, &it,
NULL);
pthread__assert(retval == 0);
- if (retval)
- err(1, "timer_settime");
}
PTQ_REMOVE(&pthread_alarmqueue, alarm, pta_next);
}
@@ -194,8 +190,6 @@
it.it_value.tv_sec, it.it_value.tv_nsec));
retval = timer_settime(pthread_alarmtimer, TIMER_ABSTIME, &it, NULL);
pthread__assert(retval == 0);
- if (retval)
- err(1, "timer_settime");
}
pthread_spinunlock(self, &pthread_alarmqlock);
Home |
Main Index |
Thread Index |
Old Index