[Date Prev][Date Next] [Chronological] [Thread] [Top]

RE: sys_errlist deprecated? (ITS#3111)

I'm not fond of the strerror_r juggling either.

I note that there's only a few places where STRERROR is used.

In liblber/sockbuf.c I think we should remove it and just log the errno.
liblber should not have any thread library dependencies.

In libldap/os-local.c I'm tempted to remove it as well.

In libldap/util-int.c the STRERROR(ENOMEM) could just have been the literal
"Out of Memory". No reason to use it there.

In slapd STRERROR is called from sock_errstr(). All of the invocations are in
a single thread except slapd/result.c. I would remove it from there, and then
there are no reentrancy issues anywhere else in slapd.

Just my $0.02...

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support

> -----Original Message-----
> From: owner-openldap-bugs@OpenLDAP.org
> [mailto:owner-openldap-bugs@OpenLDAP.org]On Behalf Of ando@sys-net.it
> Sent: Saturday, April 24, 2004 2:38 AM
> To: openldap-its@OpenLDAP.org
> Subject: sys_errlist deprecated? (ITS#3111)
> Full_Name: Pierangelo Masarati
> Version: HEAD
> OS: Linux, gcc >= 3.3
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (
> Submitted by: ando
> recent versions of gcc (>=3.3 or even earlier) complain about
> sys_errlist being
> deprecated.  Since the direct use of sys_errlist was intended
> to safely provide
> error messages in a threaded environment, but the portability could be
> endangered by its deprecation, I'm patching HEAD code to use
> strerror_r(), as
> suggested by gcc, where available.  This requires an API
> change because the
> (braindead?) interface of strerror_r() requires a buffer to
> be passed, but the
> buffer may or may not be used.  Of course the code would
> remain as is if
> strerror_r() is not available; the sequence would be:
> strerror_r(); or sys_errlist[]; or strerror(); or "unknown"
> Would this change be considered worthy (I mean -- of general
> utility and
> interest)?
> p.