httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Bloom <>
Subject Re: cvs commit: apache-2.0/src/lib/apr/network_io/unix networkio.h sockets.c sockopt.c
Date Sat, 16 Oct 1999 21:03:41 GMT
> >   +
> >   -#define SAFETY_LOCK(func_name, name_str) \
> >   +#define SAFETY_LOCK(funcname, namestr) \
> >        { \
> >        if (lock_##func_name == NULL) \
> >            if (ap_create_lock(&lock_##func_name, APR_MUTEX, APR_INTRAPROCESS,
> Did you try compiling? It looks like you missed two func_name values here.

Not only did I compile, I also RAN the code multiple times.  I don't know
how the compiler missed this.  But, I am tending to think it has something
to do with both David Reid and I fixing some problems in this file in
different ways.  Committing this change soon.

> There are a couple idioms for doing "statement" macros that I've seen:
> #define FOO(x)   if (1) { do_your_stuff(x); } else
> #define BAR(x)   do { do_your_stuff(x); } while (0)
> Both of these are a proper statement and the semicolon people will use
> simply terminates the if/do statement.
> if/do here, too.

All fixed.  Committing RSN.  Just waiting for the compile to finish.  :).
Teach me to rush through this stuff while thinking about something else.
I actually changed all of this just before committing.  Oh well.
> >   +#define INET_NTOA(x, y, len) ap_cpystrn(y, inet_ntoa(x), len);
> >   +#else
> >   +#define INET_NTOA(x, y, len) ap_cpystrn(y, inet_ntoa(x), len);
> >   +#endif
> Why are these two conditions the same? Do you imagine they would be
> different at some point? Did you just skip writing the full logic for this
> one now, to come back to it later?

These are the same, because I'm not sure what the correct solution is.
Single UNIX says inet_ntoa doesn't have to be thread-safe, but if you look
at what it is doing, it is most likely thread-safe.  Because I couldn't
find a function that is definately thread-safe, I decided to just leave
this alone until I am near my books, which are all in the office, and
which might have the actual answer.  BTW, this is the function, which lead
me to believe that we were cheating the issue, and we need to re-write all
the non-thread-safe functions.


Ryan Bloom
4205 S Miami Blvd	
RTP, NC 27709		It's a beautiful sight to see good dancers 
			doing simple steps.  It's a painful sight to
			see beginners doing complicated patterns.	

View raw message