[OpenAFS-devel] Refactoring the Solaris libafs code base

Jeffrey Altman jaltman@secure-endpoints.com
Thu, 28 Dec 2006 14:08:34 -0500


Sean O'Malley wrote:
> On Thu, 28 Dec 2006, Jeffrey Altman wrote:
> 
>> I've re-read the above sentences several times now.  I'm not sure I
>> understand which inclusions of fcntl.h you are referring to.  Do you
>> build the Windows tree?   If not, I would leave it alone.
>>
>> The Microsoft compilers have included fcntl.h going back at least a
>> decade.  HAVE_FCNTL_H is defined in the windows config.h file.  So if
>> you are asking if   #ifdef HAVE_FCNTL_H  can be removed, the answer
>> from the perspective of Windows is 'yes' but I really must ask "why
>> bother?"  If the code compiles cleanly now, why remove the #ifdef?
> 
> It is actually:
> #ifdef AFS_NT40_ENV
> #include <fcntl.h>
> #else

Are there any symbols from fcntl.h that are being used by anything
other than code within AFS_NT40_ENV ?

I prefer to pull in as few headers as necessary to correctly compile
the code.

If there are places where fcntl.h is being included for multiple
operating systems or for AFS_NT40_ENV and HAVE_FCNTL_H or even just if
HAVE_FCNTL_H, then I would remove the #ifdef conditionals and include
the file once.

If fcntl.h is only being included on Windows and never used by any of
the UNIX platforms, I would leave it in the AFS_NT40_ENV condition.

Jeffrey Altman