[Libsysio-commit] HEAD: libsysio/drivers/native fs_native.c
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2007-05-01 16:34:00
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv24463/drivers/native Modified Files: fs_native.c Log Message: The `C' preprocessor tests now look for definition of a symbol rather than a value. This enables some builds I'm told. Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.60 retrieving revision 1.61 diff -u -w -b -B -p -r1.60 -r1.61 --- fs_native.c 30 Apr 2007 23:24:12 -0000 1.60 +++ fs_native.c 1 May 2007 16:33:52 -0000 1.61 @@ -80,13 +80,12 @@ #include <sys/uio.h> #endif +#undef DIR_CVT_64 #if defined(SYSIO_SYS_getdirentries) -#define DIR_CVT_64 0 #elif defined(SYSIO_SYS_getdents64) -#define DIR_CVT_64 0 #elif defined(SYSIO_SYS_getdents) #if defined(_LARGEFILE64_SOURCE) -#define DIR_CVT_64 1 +#define DIR_CVT_64 /* * Kernel version of directory entry. */ @@ -97,8 +96,6 @@ struct linux_dirent { char ld_name[1]; }; #include <dirent.h> -#else /* !defined(_LARGEFILE64_SOURCE) */ -#define DIR_CVT_64 0 #endif /* defined(_LARGEFILE64_SOURCE) */ #else /* catch-none */ #error No usable directory fill entries interface available @@ -917,7 +914,7 @@ native_pos(int fd, _SYSIO_OFF_T *offset, assert(*offset >= 0); off = *offset; -#if _LARGEFILE64_SOURCE && defined(SYSIO_SYS__llseek) +#if defined(_LARGEFILE64_SOURCE) && defined(SYSIO_SYS__llseek) { int err; err = @@ -1011,7 +1008,7 @@ native_filldirentries(struct inode *ino, size_t nbytes) { struct native_inode *nino = I2NI(ino); -#if DIR_CVT_64 +#ifdef DIR_CVT_64 char *bp; size_t count; struct linux_dirent *ldp; @@ -1026,7 +1023,7 @@ native_filldirentries(struct inode *ino, assert(nino->ni_fd >= 0); -#if DIR_CVT_64 +#ifdef DIR_CVT_64 count = nbytes; while (!(bp = malloc(count))) { count /= 2; @@ -1036,12 +1033,12 @@ native_filldirentries(struct inode *ino, #endif cc = native_ifilldirentries(nino, posp, bp, count); if (cc < 0) { -#if DIR_CVT_64 +#ifdef DIR_CVT_64 free(bp); #endif return cc; } -#if DIR_CVT_64 +#ifdef DIR_CVT_64 ldp = (struct linux_dirent *)bp; d64p = (struct dirent64 *)buf; while (cc) { |