Skip to Content.
Sympa Menu

freetds - [freetds] errno and threads

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT schemamania.org>
  • To: TDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: [freetds] errno and threads
  • Date: Mon, 4 Aug 2003 23:57:10 -0400

Investigating what seems like a silly warning[1] in read.c, I came across
this comment:

if (-1 == tds_iconv(tds, tds->iconv_info, to_client,
&ptemp, &templeft, outbuf, outbytesleft)) {
/* FIXME do not use errno, thread problems */
if (errno != EINVAL)
break;
}

AFAIK, there's no fix. GNU iconv at least is documented as returning
information through errno. On some multithreaded platforms, errno is
actually a macro to a function call (which prevents assignment, but allows
typical use).

I think the above code is right, and the comment is not. If there is an
accepted alternative, would someone please point the way? Else I'm going
to remove the comment.

--jkl

1. "src/tds/read.c:613: warning: statement with no effect"
I think the compiler doesn't notice that outbytesleft may be modified by
tds_iconv().






Archive powered by MHonArc 2.6.24.

Top of Page