httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@attglobal.net>
Subject Re: Code questions (server/mpm_common.c)
Date Mon, 11 Mar 2002 14:17:09 GMT
"Sander Striker" <striker@apache.org> writes:

> Hi,
> 
> server/mpm_common.c:363
> #if defined(QNX) || defined(MPE) || defined(BEOS) || defined(_OSD_POSIX) || defined(TPF)
|| defined(__TANDEM) || defined(OS2) ||
> defined(WIN32) || defined(NETWARE)
> 
> Can I break this line into smaller chunks?  If so, how?
> I seem a bit rusty on how the various preprocessors handle
> multiline #ifs (if they even do).

Look in ap_config.h for the way to do it (look for "SUNOS4")

Why not move this OS-specific stuff to ap_config.h and define
AP_HAVE_SUPLEMENTARY_GROUPS if we aren't on one of those platforms,
and then use AP_HAVE_SUPPLEMENTARY_GROUPS to see what to do?

(I'm assuming that the presence of setgrent() and friends isn't good
enough to make the decision.)

> server/mpm_common.c:442
>     rv = apr_file_close(pod->pod_in);
>     if (rv != APR_SUCCESS) {
>         return rv;
>     }
> 
>     return rv;
> }
> 
> If we are going to waste the if, we might aswell return
> APR_SUCCESS, no?

plenty of ways to skin a cat, all of them good

as for this code, go for the APR_SUCCESS (you're left with a trade-off
between compactness vs. using a style that can be extended if more
work is added later)

-- 
Jeff Trawick | trawick@attglobal.net | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...

Mime
View raw message