[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bug in lt_dlerror
From: |
John Gruenenfelder |
Subject: |
Bug in lt_dlerror |
Date: |
Thu, 10 Oct 2002 18:42:13 -0700 |
User-agent: |
Mutt/1.4i |
I think I have found my source of "unknown error" messages in my program. I
was checking the return value of lt_dlerror() to see if any errors might have
occured. I believe the autobook says this is a good idea. And it used to
work too.
The documentation for lt_dlerror() says:
- Function: const char * lt_dlerror (void)
Return a human readable string describing the most recent error
that occurred from any of libltdl's functions. Return `NULL' if
no errors have occurred since initialization or since it was last
called.
I was checking for that NULL return value to make sure no errors had occured.
However, looking at the code in ltdl.c:
const char *
lt_dlerror ()
{
const char *error;
LT_DLMUTEX_GETERROR (error);
LT_DLMUTEX_SETERROR (0);
return error ? error : LT_DLSTRERROR (UNKNOWN);
}
It seems to me that lt_dlerror() is going to *always* return a non-NULL value,
since LT_DLSTRERROR (UNKNOWN) becomes "unknown error". That last line should
instead be:
return error ? error : NULL;
Or am I missing something?
--
--John Gruenenfelder Research Assistant, Steward Observatory, U of Arizona
address@hidden
"This is the most fun I've had without being drenched in the blood
of my enemies!"
--Sam of Sam & Max
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Bug in lt_dlerror,
John Gruenenfelder <=