From 76fe441a7bf75d73962641b785f158b5cc9dc7f8 Mon Sep 17 00:00:00 2001 From: markm Date: Fri, 29 Mar 2002 22:43:43 +0000 Subject: Do not use __progname directly (except in [gs]etprogname(3)). Also, make an internal _getprogname() that is used only inside libc. For libc, getprogname(3) is a weak symbol in case a function of the same name is defined in userland. --- lib/libc_r/uthread/uthread_spinlock.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'lib/libc_r') diff --git a/lib/libc_r/uthread/uthread_spinlock.c b/lib/libc_r/uthread/uthread_spinlock.c index 696174e..7333709 100644 --- a/lib/libc_r/uthread/uthread_spinlock.c +++ b/lib/libc_r/uthread/uthread_spinlock.c @@ -33,14 +33,16 @@ * */ +#include #include +#include #include -#include #include -#include -#include "pthread_private.h" +#include + +#include -extern char *__progname; +#include "pthread_private.h" /* * Lock a location for the running thread. Yield to allow other @@ -91,7 +93,7 @@ _spinlock_debug(spinlock_t *lck, char *fname, int lineno) cnt++; if (cnt > 100) { char str[256]; - snprintf(str, sizeof(str), "%s - Warning: Thread %p attempted to lock %p from %s (%d) was left locked from %s (%d)\n", __progname, curthread, lck, fname, lineno, lck->fname, lck->lineno); + snprintf(str, sizeof(str), "%s - Warning: Thread %p attempted to lock %p from %s (%d) was left locked from %s (%d)\n", _getprogname(), curthread, lck, fname, lineno, lck->fname, lck->lineno); __sys_write(2,str,strlen(str)); __sleep(1); cnt = 0; -- cgit v1.1