From d26b63d96fe5fe3509bfc2429ec5ff22f586981d Mon Sep 17 00:00:00 2001 From: scjody Date: Wed, 9 May 2007 22:28:54 +0000 Subject: [PATCH] Branch b1_4 Clean up libsysio compiler warnings on XT3. b=12332 i=adilger i=walter --- libsysio/drivers/native/fs_native.c | 2 +- libsysio/include/file.h | 4 ++-- libsysio/include/native.h | 22 +++++++++++----------- libsysio/include/sysio-cmn.h | 11 ++--------- libsysio/include/sysio.h | 26 +++++++++++++------------- libsysio/include/xtio.h | 12 ++++++------ libsysio/src/chdir.c | 4 ++-- libsysio/src/fcntl.c | 10 +++++----- libsysio/src/file.c | 2 +- libsysio/src/file_hack.c | 2 +- libsysio/src/fs.c | 2 +- libsysio/src/getdirentries.c | 2 +- libsysio/src/init.c | 34 +++++++++++++++++----------------- libsysio/src/inode.c | 10 +++++----- libsysio/src/lseek.c | 4 ++-- libsysio/src/mount.c | 2 +- libsysio/src/namei.c | 2 +- libsysio/src/rw.c | 30 +++++++++++++++--------------- libsysio/src/stat.c | 12 ++++++------ libsysio/src/truncate.c | 4 ++-- libsysio/tests/startup.c | 4 ++-- 21 files changed, 97 insertions(+), 104 deletions(-) diff --git a/libsysio/drivers/native/fs_native.c b/libsysio/drivers/native/fs_native.c index 75ae531..1909e2e 100644 --- a/libsysio/drivers/native/fs_native.c +++ b/libsysio/drivers/native/fs_native.c @@ -933,7 +933,7 @@ native_pos(int fd, _SYSIO_OFF_T *offset, int whence) assert(*offset >= 0); off = *offset; -#if _LARGEFILE64_SOURCE && defined(SYSIO_SYS__llseek) +#if defined(_LARGEFILE64_SOURCE) && defined(SYSIO_SYS__llseek) { int err; err = diff --git a/libsysio/include/file.h b/libsysio/include/file.h index ed5041f..d30e84e 100644 --- a/libsysio/include/file.h +++ b/libsysio/include/file.h @@ -61,7 +61,7 @@ #define _SEEK_MAX(fil) \ (_F_LARGEFILE(fil) ? _SYSIO_OFF_T_MAX : LONG_MAX) -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE #define _SYSIO_FLOCK flock64 #else #define _SYSIO_FLOCK flock @@ -137,7 +137,7 @@ extern struct file *_sysio_fd_find(int fd); extern int _sysio_fd_set(struct file *fil, int fd, int force); extern int _sysio_fd_dup(int oldfd, int newfd, int force); extern int _sysio_fd_close_all(void); -#if ZERO_SUM_MEMORY +#ifdef ZERO_SUM_MEMORY extern void _sysio_fd_shutdown(void); #endif extern _SYSIO_OFF_T _sysio_lseek_prepare(struct file *fil, diff --git a/libsysio/include/native.h b/libsysio/include/native.h index 847ca03..d0c024b 100644 --- a/libsysio/include/native.h +++ b/libsysio/include/native.h @@ -97,22 +97,22 @@ do { \ /* * System calls. */ -#if _LARGEFILE64_SOURCE && defined(SYS_lstat64) +#if defined(_LARGEFILE64_SOURCE) && defined(SYS_lstat64) #define SYSIO_SYS_stat SYS_lstat64 #elif defined(SYS_lstat) #define SYSIO_SYS_stat SYS_lstat #endif -#if _LARGEFILE64_SOURCE && defined(SYS_fstat64) +#if defined(_LARGEFILE64_SOURCE) && defined(SYS_fstat64) #define SYSIO_SYS_fstat SYS_fstat64 #elif defined(SYS_fstat) #define SYSIO_SYS_fstat SYS_fstat #endif -#if _LARGEFILE64_SOURCE && defined(SYS_truncate64) +#if defined(_LARGEFILE64_SOURCE) && defined(SYS_truncate64) #define SYSIO_SYS_truncate SYS_truncate64 #elif defined(SYS_truncate) #define SYSIO_SYS_truncate SYS_truncate #endif -#if _LARGEFILE64_SOURCE && defined(SYS_ftruncate64) +#if defined(_LARGEFILE64_SOURCE) && defined(SYS_ftruncate64) #define SYSIO_SYS_ftruncate SYS_ftruncate64 #elif defined(SYS_ftruncate) #define SYSIO_SYS_ftruncate SYS_ftruncate @@ -123,7 +123,7 @@ do { \ #if defined(SYS_close) #define SYSIO_SYS_close SYS_close #endif -#if _LARGEFILE64_SOURCE && defined(SYS_lseek64) +#if defined(_LARGEFILE64_SOURCE) && defined(SYS_lseek64) #define SYSIO_SYS_lseek SYS_lseek64 #elif defined(SYS_lseek) #define SYSIO_SYS_lseek SYS_lseek @@ -147,17 +147,17 @@ do { \ #if defined(SYS_writev) #define SYSIO_SYS_writev SYS_writev #endif -#if _LARGEFILE64_SOURCE && defined(SYS_pread64) +#if defined(_LARGEFILE64_SOURCE) && defined(SYS_pread64) #define SYSIO_SYS_pread SYS_pread64 #elif defined(SYS_pread) #define SYSIO_SYS_pread SYS_pread #endif -#if _LARGEFILE64_SOURCE && defined(SYS_pwrite64) +#if defined(_LARGEFILE64_SOURCE) && defined(SYS_pwrite64) #define SYSIO_SYS_pwrite SYS_pwrite64 #elif defined(SYS_pwrite) #define SYSIO_SYS_pwrite SYS_pwrite #endif -#if _LARGEFILE64_SOURCE && defined(SYS_fcntl64) +#if defined(_LARGEFILE64_SOURCE) && defined(SYS_fcntl64) #define SYSIO_SYS_fcntl SYS_fcntl64 #elif defined(SYS_fcntl) #define SYSIO_SYS_fcntl SYS_fcntl @@ -165,7 +165,7 @@ do { \ #if defined(SYS_fsync) #define SYSIO_SYS_fsync SYS_fsync #endif -#if ALPHA_LINUX && defined(SYS_osf_fdatasync) +#if defined(ALPHA_LINUX) && defined(SYS_osf_fdatasync) #define SYSIO_SYS_fdatasync SYS_osf_fdatasync #elif defined(SYS_fdatasync) #define SYSIO_SYS_fdatasync SYS_fdatasync @@ -192,13 +192,13 @@ do { \ #define SYSIO_SYS_rmdir SYS_rmdir #endif #if defined(SYS_getdirentries) -#if _LARGEFILE64_SOURCE && defined(SYS_getdirentries64) +#if defined(_LARGEFILE64_SOURCE) && defined(SYS_getdirentries64) #define SYSIO_SYS_getdirentries SYS_getdirentries64 #elif defined(SYS_getdirentries) #define SYSIO_SYS_getdirentries SYS_getdirentries #endif #endif -#if _LARGEFILE64_SOURCE && defined(SYS_getdents64) +#if defined(_LARGEFILE64_SOURCE) && defined(SYS_getdents64) # define SYSIO_SYS_getdents64 SYS_getdents64 #elif defined(SYS_getdents) # if defined (__mips64__) diff --git a/libsysio/include/sysio-cmn.h b/libsysio/include/sysio-cmn.h index 2ada2e8..abb6ddd 100644 --- a/libsysio/include/sysio-cmn.h +++ b/libsysio/include/sysio-cmn.h @@ -51,17 +51,10 @@ #define __IS_UNUSED #endif -#ifndef _LARGEFILE64_SOURCE -/* - * Not glibc I guess. Define this ourselves. - */ -#define _LARGEFILE64_SOURCE 0 -#endif - /* * Define internal file-offset type and it's maximum value. */ -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE #define _SYSIO_OFF_T off64_t #ifdef LLONG_MAX #define _SYSIO_OFF_T_MAX (LLONG_MAX) @@ -80,7 +73,7 @@ * Internally, all file status is carried in the 64-bit capable * structure. */ -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE #define intnl_xtvec xtvec64 #else #define intnl_xtvec xtvec diff --git a/libsysio/include/sysio.h b/libsysio/include/sysio.h index a8a528b..e64ead5 100644 --- a/libsysio/include/sysio.h +++ b/libsysio/include/sysio.h @@ -78,7 +78,7 @@ * Internally, all directory entries are carried in the 64-bit capable * structure. */ -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE #define intnl_dirent dirent64 #else #define intnl_dirent dirent @@ -89,7 +89,7 @@ struct dirent; * Internally, all file status is carried in the 64-bit capable * structure. */ -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE #define intnl_stat stat64 #else #define intnl_stat stat @@ -97,7 +97,7 @@ struct dirent; struct stat; #ifdef _HAVE_STATVFS -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE #define intnl_statvfs statvfs64 #else #define intnl_statvfs statvfs @@ -177,14 +177,14 @@ extern int SYSIO_INTERFACE_NAME(dup2)(int oldfd, int newfd); extern int SYSIO_INTERFACE_NAME(fcntl)(int fd, int cmd, ...); extern int SYSIO_INTERFACE_NAME(fcntl64)(int fd, int cmd, ...); extern int SYSIO_INTERFACE_NAME(fstat)(int fd, struct stat *buf); -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE extern int SYSIO_INTERFACE_NAME(fstat64)(int fd, struct stat64 *buf); extern int SYSIO_INTERFACE_NAME(lstat64)(const char *path, struct stat64 *buf); #endif extern int SYSIO_INTERFACE_NAME(fsync)(int fd); extern char *SYSIO_INTERFACE_NAME(getcwd)(char *buf, size_t size); extern off_t SYSIO_INTERFACE_NAME(lseek)(int fd, off_t offset, int whence); -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE extern off64_t SYSIO_INTERFACE_NAME(lseek64)(int fd, off64_t offset, int whence); #endif @@ -195,7 +195,7 @@ extern int SYSIO_INTERFACE_NAME(getdirentries)(int fd, char *buf, int nbytes , #else extern ssize_t SYSIO_INTERFACE_NAME(getdirentries)(int fd, char *buf, size_t nbytes, off_t *basep); -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE extern ssize_t SYSIO_INTERFACE_NAME(getdirentries64)(int fd, char *buf, size_t nbytes, @@ -204,15 +204,15 @@ extern ssize_t SYSIO_INTERFACE_NAME(getdirentries64)(int fd, #endif extern int SYSIO_INTERFACE_NAME(mkdir)(const char *path, mode_t mode); extern int SYSIO_INTERFACE_NAME(open)(const char *path, int flag, ...); -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE extern int SYSIO_INTERFACE_NAME(open64)(const char *path, int flag, ...); #endif extern int SYSIO_INTERFACE_NAME(creat)(const char *path, mode_t mode); -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE extern int SYSIO_INTERFACE_NAME(creat64)(const char *path, mode_t mode); #endif extern int SYSIO_INTERFACE_NAME(stat)(const char *path, struct stat *buf); -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE extern int SYSIO_INTERFACE_NAME(stat64)(const char *path, struct stat64 *buf); #endif extern ssize_t SYSIO_INTERFACE_NAME(read)(int fd, void *buf, size_t count); @@ -233,21 +233,21 @@ extern ssize_t SYSIO_INTERFACE_NAME(writev)(int fd, int count); #ifdef _HAVE_STATVFS extern int SYSIO_INTERFACE_NAME(statvfs)(const char *path, struct statvfs *buf); -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE extern int SYSIO_INTERFACE_NAME(statvfs64)(const char *path, struct statvfs64 *buf); #endif extern int SYSIO_INTERFACE_NAME(fstatvfs)(int fd, struct statvfs *buf); -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE extern int SYSIO_INTERFACE_NAME(fstatvfs64)(int fd, struct statvfs64 *buf); #endif #endif extern int SYSIO_INTERFACE_NAME(truncate)(const char *path, off_t length); -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE extern int SYSIO_INTERFACE_NAME(truncate64)(const char *path, off64_t length); #endif extern int SYSIO_INTERFACE_NAME(ftruncate)(int fd, off_t length); -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE extern int SYSIO_INTERFACE_NAME(ftruncate64)(int fd, off64_t length); #endif extern int SYSIO_INTERFACE_NAME(rmdir)(const char *path); diff --git a/libsysio/include/xtio.h b/libsysio/include/xtio.h index 5f9050d..a5798f1 100644 --- a/libsysio/include/xtio.h +++ b/libsysio/include/xtio.h @@ -106,7 +106,7 @@ extern ioid_t SYSIO_INTERFACE_NAME(ipreadv)(int fd, size_t count, off_t offset); -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE /* * Post asynch read into buffers mapped by an iovec from file at given offset. */ @@ -124,7 +124,7 @@ extern ioid_t SYSIO_INTERFACE_NAME(ipread)(int fd, size_t count, off_t offset); -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE /* * Post asynch read into buffer from file at given offset. */ @@ -142,7 +142,7 @@ extern ssize_t SYSIO_INTERFACE_NAME(preadv)(int fd, size_t count, off_t offset); -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE /* * Read into buffers mapped by an iovec from file at given offset. */ @@ -225,7 +225,7 @@ extern ioid_t SYSIO_INTERFACE_NAME(ipwritev)(int fd, const struct iovec *iov, size_t count, off_t offset); -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE /* * Post asynch write from buffers mapped by an iovec to file at given offset. */ @@ -243,7 +243,7 @@ extern ioid_t SYSIO_INTERFACE_NAME(ipwrite)(int fd, size_t count, off_t offset); -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE /* * Post asynch write from buffer to file at given offset. */ @@ -261,7 +261,7 @@ extern ssize_t SYSIO_INTERFACE_NAME(pwritev)(int fd, size_t count, off_t offset); -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE /* * Write from buffers mapped by an iovec to file at given offset. */ diff --git a/libsysio/src/chdir.c b/libsysio/src/chdir.c index f48c0fe..3f5c900 100644 --- a/libsysio/src/chdir.c +++ b/libsysio/src/chdir.c @@ -79,7 +79,7 @@ #include "file.h" #include "sysio-symbols.h" -#if DEFER_INIT_CWD +#ifdef DEFER_INIT_CWD const char *_sysio_init_cwd = NULL; #endif @@ -240,7 +240,7 @@ SYSIO_INTERFACE_NAME(getcwd)(char *buf, size_t size) SYSIO_INTERFACE_DISPLAY_BLOCK; SYSIO_INTERFACE_ENTER; -#if DEFER_INIT_CWD +#ifdef DEFER_INIT_CWD if (!_sysio_cwd) { struct pnode *pno; diff --git a/libsysio/src/fcntl.c b/libsysio/src/fcntl.c index 703e09d..b779d70 100644 --- a/libsysio/src/fcntl.c +++ b/libsysio/src/fcntl.c @@ -194,14 +194,14 @@ _sysio_vfcntl(int fd, int cmd, va_list ap) } } break; -#if !(_LARGEFILE64_SOURCE || F_GETLK64 == F_GETLK) +#if !(defined(_LARGEFILE64_SOURCE) || F_GETLK64 == F_GETLK) case F_GETLK: case F_SETLK: case F_SETLKW: { struct intnl_stat buf; struct flock *fl; -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE struct _SYSIO_FLOCK flock64; #endif @@ -220,7 +220,7 @@ _sysio_vfcntl(int fd, int cmd, va_list ap) * Copy args to a temp and normalize. */ fl = va_arg(ap, struct flock *); -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE flock64.l_type = fl->l_type; flock64.l_whence = fl->l_whence; flock64.l_start = fl->l_start; @@ -234,7 +234,7 @@ _sysio_vfcntl(int fd, int cmd, va_list ap) rtn = -1; break; } -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE /* * Copy back. Note that the fcntl_lock call * should have ensured that no overflow was possible. @@ -251,7 +251,7 @@ _sysio_vfcntl(int fd, int cmd, va_list ap) } break; #endif /* !(_LARGEFILE64_SOURCE || F_GETLK64 == F_GETLK) */ -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE case F_GETLK64: case F_SETLK64: case F_SETLKW64: diff --git a/libsysio/src/file.c b/libsysio/src/file.c index fbd91d8..9ed054e 100644 --- a/libsysio/src/file.c +++ b/libsysio/src/file.c @@ -149,7 +149,7 @@ fd_grow(size_t n) return 0; } -#if ZERO_SUM_MEMORY +#ifdef ZERO_SUM_MEMORY void _sysio_fd_shutdown() { diff --git a/libsysio/src/file_hack.c b/libsysio/src/file_hack.c index c09a97d..2eb6105 100644 --- a/libsysio/src/file_hack.c +++ b/libsysio/src/file_hack.c @@ -188,7 +188,7 @@ fd_grow(oftab_t *oftab, size_t n) return 0; } -#if ZERO_SUM_MEMORY +#ifdef ZERO_SUM_MEMORY static void free_oftab(oftab_t *ot) { if (ot->table) { diff --git a/libsysio/src/fs.c b/libsysio/src/fs.c index 579ae01..0c9bd52 100644 --- a/libsysio/src/fs.c +++ b/libsysio/src/fs.c @@ -106,7 +106,7 @@ _sysio_fssw_register(const char *name, struct fssw_ops *ops) return 0; } -#if ZERO_SUM_MEMORY +#ifdef ZERO_SUM_MEMORY /* * Shutdown */ diff --git a/libsysio/src/getdirentries.c b/libsysio/src/getdirentries.c index 70a1a28..151829d 100644 --- a/libsysio/src/getdirentries.c +++ b/libsysio/src/getdirentries.c @@ -106,7 +106,7 @@ PREPEND(_, SYSIO_INTERFACE_NAME(getdirentries64))(int fd, SYSIO_INTERFACE_RETURN(cc < 0 ? -1 : cc, cc < 0 ? (int )cc : 0); } -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE #undef getdirentries64 sysio_sym_strong_alias(PREPEND(_, SYSIO_INTERFACE_NAME(getdirentries64)), SYSIO_INTERFACE_NAME(getdirentries64)) diff --git a/libsysio/src/init.c b/libsysio/src/init.c index c82d601..470b5c2 100644 --- a/libsysio/src/init.c +++ b/libsysio/src/init.c @@ -45,17 +45,17 @@ #define _BSD_SOURCE #endif -#if SYSIO_TRACING +#ifdef SYSIO_TRACING #include #endif #include -#ifdef _BSD_SOURCE +#if defined(_BSD_SOURCE) || defined(SYSIO_TRACING) #include #endif #include #include #include -#if SYSIO_TRACING +#ifdef SYSIO_TRACING #include #endif #include @@ -68,7 +68,7 @@ #include "sysio.h" #include "xtio.h" -#if SYSIO_TRACING +#ifdef SYSIO_TRACING #include "native.h" #endif #include "inode.h" @@ -81,7 +81,7 @@ #include "stdfd.h" #endif -#if SYSIO_TRACING +#ifdef SYSIO_TRACING /* * Tracing callback record. @@ -160,7 +160,7 @@ _sysio_init() extern int _sysio_sockets_init(void); #endif -#if SYSIO_TRACING +#ifdef SYSIO_TRACING /* * Initialize tracing callback queues. */ @@ -214,12 +214,12 @@ _sysio_shutdown() _sysio_unmount_all() == 0)) abort(); -#if ZERO_SUM_MEMORY +#ifdef ZERO_SUM_MEMORY _sysio_fd_shutdown(); _sysio_i_shutdown(); _sysio_fssw_shutdown(); _sysio_access_shutdown(); -#if SYSIO_TRACING +#ifdef SYSIO_TRACING { struct trace_callback *tcb; @@ -235,7 +235,7 @@ _sysio_shutdown() #endif } -#if SYSIO_TRACING +#ifdef SYSIO_TRACING #if !(defined(_HAVE_ASPRINTF) && _HAVE_ASPRINTF) /* @@ -929,7 +929,7 @@ do_command(char *buf) return -EINVAL; } -#if SYSIO_TRACING +#ifdef SYSIO_TRACING /* * Set/Unset tracing. */ @@ -1040,7 +1040,7 @@ _sysio_boot_namespace(const char *arg) if (err) break; } -#if SYSIO_TRACING +#ifdef SYSIO_TRACING if (err) _sysio_cprintf("+NS init+ failed at expr %u (last = %s): %s\n", count, @@ -1051,7 +1051,7 @@ _sysio_boot_namespace(const char *arg) return err; } -#if DEFER_INIT_CWD +#ifdef DEFER_INIT_CWD /* * Set deferred initial working directory. */ @@ -1067,15 +1067,15 @@ _sysio_boot_cwd(const char *arg) /* * Given an identifier and it's arguments, perform optional initializations. */ -int +int _sysio_boot(const char *opt, const char *arg) { struct option_value_info vec[] = { -#if SYSIO_TRACING +#ifdef SYSIO_TRACING { "trace", NULL }, /* tracing? */ #endif { "namespace", NULL }, /* init namespace? */ -#if DEFER_INIT_CWD +#ifdef DEFER_INIT_CWD { "cwd", NULL }, /* init working dir */ #endif { NULL, NULL } @@ -1083,11 +1083,11 @@ _sysio_boot(const char *opt, const char *arg) struct option_value_info *v; unsigned u; static int (*f[])(const char *) = { -#if SYSIO_TRACING +#ifdef SYSIO_TRACING _sysio_boot_tracing, #endif _sysio_boot_namespace, -#if DEFER_INIT_CWD +#ifdef DEFER_INIT_CWD _sysio_boot_cwd, #endif NULL /* can't happen */ diff --git a/libsysio/src/inode.c b/libsysio/src/inode.c index 8ab6236..fbe027d 100644 --- a/libsysio/src/inode.c +++ b/libsysio/src/inode.c @@ -101,7 +101,7 @@ static size_t max_names = (2 * NAMES_TABLE_LEN); */ #define PNODES_PER_CHUNK ((8 * 1024) / sizeof(struct pnode) - 2) -#if ZERO_SUM_MEMORY +#ifdef ZERO_SUM_MEMORY /* * Allocation information for pnodes bulk allocation. */ @@ -142,7 +142,7 @@ _sysio_i_init() for (i = 0; i < NAMES_TABLE_LEN; i++) LIST_INIT(&names[i]); -#if ZERO_SUM_MEMORY +#ifdef ZERO_SUM_MEMORY LIST_INIT(&pnblocks); #endif TAILQ_INIT(&_sysio_pnodes); @@ -465,12 +465,12 @@ static void more_pnodes() { size_t n; -#if ZERO_SUM_MEMORY +#ifdef ZERO_SUM_MEMORY struct pnodes_block *pnblk; #endif struct pnode *pno; -#if ZERO_SUM_MEMORY +#ifdef ZERO_SUM_MEMORY pnblk = malloc(sizeof(struct pnodes_block)); pno = NULL; if (pnblk) { @@ -489,7 +489,7 @@ more_pnodes() } while (--n); } -#if ZERO_SUM_MEMORY +#ifdef ZERO_SUM_MEMORY /* * Shutdown */ diff --git a/libsysio/src/lseek.c b/libsysio/src/lseek.c index 687071b..91d865d 100644 --- a/libsysio/src/lseek.c +++ b/libsysio/src/lseek.c @@ -121,7 +121,7 @@ _sysio_lseek(struct file *fil, return pos; } -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE #undef lseek64 extern off64_t @@ -200,7 +200,7 @@ SYSIO_INTERFACE_NAME(llseek)(unsigned int fd __IS_UNUSED, fil = _sysio_fd_find(fd); if (!fil) SYSIO_INTERFACE_RETURN(-1, -EBADF); -#if !_LARGEFILE64_SOURCE +#ifndef _LARGEFILE64_SOURCE if (offset_high) { /* * We are using 32-bit internals. This just isn't diff --git a/libsysio/src/mount.c b/libsysio/src/mount.c index 9e8f9ea..6fed655 100644 --- a/libsysio/src/mount.c +++ b/libsysio/src/mount.c @@ -277,7 +277,7 @@ _sysio_mount_root(const char *source, return err; _sysio_root = mnt->mnt_root; -#if !DEFER_INIT_CWD +#ifndef DEFER_INIT_CWD /* * It is very annoying to have to set the current working directory. * So... If it isn't set, make it the root now. diff --git a/libsysio/src/namei.c b/libsysio/src/namei.c index e339f04..7f8c1e4 100644 --- a/libsysio/src/namei.c +++ b/libsysio/src/namei.c @@ -186,7 +186,7 @@ _sysio_path_walk(struct pnode *parent, struct nameidata *nd) parent = nd->nd_root; } -#if DEFER_INIT_CWD +#ifdef DEFER_INIT_CWD if (!parent) { const char *icwd; diff --git a/libsysio/src/rw.c b/libsysio/src/rw.c index 328f076..300f073 100644 --- a/libsysio/src/rw.c +++ b/libsysio/src/rw.c @@ -118,7 +118,7 @@ _sysio_iiox(int (*f)(struct inode *, struct ioctx *), cc = _sysio_validx(xtv, xtv_count, iov, iov_count, -#if _LARGEFILE64_SOURCE && defined(O_LARGEFILE) +#if defined(_LARGEFILE64_SOURCE) && defined(O_LARGEFILE) (fil->f_flags & O_LARGEFILE) == 0 ? LONG_MAX : @@ -465,7 +465,7 @@ PREPEND(_, SYSIO_INTERFACE_NAME(ipreadv))(int fd, SYSIO_INTERFACE_RETURN(ioctx, 0); } -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE #undef ipread64v sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(ipreadv)), SYSIO_INTERFACE_NAME(ipread64v)) @@ -515,7 +515,7 @@ PREPEND(_, SYSIO_INTERFACE_NAME(preadv))(int fd, SYSIO_INTERFACE_RETURN(err ? -1 : cc, err); } -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE #undef pread64v sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(preadv)), SYSIO_INTERFACE_NAME(pread64v)) @@ -579,7 +579,7 @@ error: SYSIO_INTERFACE_RETURN(ioctx, 0); } -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE #undef ipread64 sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(ipread)), SYSIO_INTERFACE_NAME(ipread64)) @@ -633,7 +633,7 @@ PREPEND(_, SYSIO_INTERFACE_NAME(pread))(int fd, SYSIO_INTERFACE_RETURN(err ? -1 : cc, err); } -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE #undef pread64 sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(pread)), SYSIO_INTERFACE_NAME(pread64)) @@ -698,13 +698,13 @@ PREPEND(_, SYSIO_INTERFACE_NAME(ireadx))(int fd, SYSIO_INTERFACE_RETURN(err ? IOID_FAIL : ioctx, err); } -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE #undef iread64x sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(ireadx)), SYSIO_INTERFACE_NAME(iread64x)) #endif -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE ioid_t SYSIO_INTERFACE_NAME(ireadx)(int fd, const struct iovec *iov, size_t iov_count, @@ -774,7 +774,7 @@ SYSIO_INTERFACE_NAME(readx)(int fd, return SYSIO_INTERFACE_NAME(iowait)(ioid); } -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE #undef iread64x ssize_t SYSIO_INTERFACE_NAME(read64x)(int fd, @@ -993,7 +993,7 @@ PREPEND(_, SYSIO_INTERFACE_NAME(ipwritev))(int fd, SYSIO_INTERFACE_RETURN(ioctx, 0); } -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE #undef ipwrite64v sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(ipwritev)), SYSIO_INTERFACE_NAME(ipwrite64v)) @@ -1043,7 +1043,7 @@ PREPEND(_, SYSIO_INTERFACE_NAME(pwritev))(int fd, SYSIO_INTERFACE_RETURN(err ? -1 : cc, err); } -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE #undef pwrite64v sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(pwritev)), SYSIO_INTERFACE_NAME(pwrite64v)) @@ -1107,7 +1107,7 @@ error: SYSIO_INTERFACE_RETURN(ioctx, 0); } -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE #undef ipwrite64 sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(ipwrite)), SYSIO_INTERFACE_NAME(ipwrite64)) @@ -1161,7 +1161,7 @@ PREPEND(_, SYSIO_INTERFACE_NAME(pwrite))(int fd, SYSIO_INTERFACE_RETURN(err ? -1 : cc, err); } -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE #undef pwrite64 sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(pwrite)), SYSIO_INTERFACE_NAME(pwrite64)) @@ -1222,13 +1222,13 @@ PREPEND(_, SYSIO_INTERFACE_NAME(iwritex))(int fd, SYSIO_INTERFACE_RETURN(err ? IOID_FAIL : ioctx, err); } -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE #undef iwrite64x sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(iwritex)), SYSIO_INTERFACE_NAME(iwrite64x)) #endif -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE ioid_t SYSIO_INTERFACE_NAME(iwritex)(int fd, const struct iovec *iov, size_t iov_count, @@ -1299,7 +1299,7 @@ SYSIO_INTERFACE_NAME(writex)(int fd, return SYSIO_INTERFACE_NAME(iowait)(ioid); } -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE #undef write64x ssize_t SYSIO_INTERFACE_NAME(write64x)(int fd, diff --git a/libsysio/src/stat.c b/libsysio/src/stat.c index 44a4b88..607924a 100644 --- a/libsysio/src/stat.c +++ b/libsysio/src/stat.c @@ -68,7 +68,7 @@ #define _STAT_VER 0 #endif -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE static void convstat(struct stat64 *st64_buf, struct stat *st_buf) { @@ -97,7 +97,7 @@ PREPEND(__, SYSIO_INTERFACE_NAME(fxstat))(int __ver, struct file *fil; int err; struct intnl_stat *buf; -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE struct stat64 st64; #endif SYSIO_INTERFACE_DISPLAY_BLOCK; @@ -114,7 +114,7 @@ PREPEND(__, SYSIO_INTERFACE_NAME(fxstat))(int __ver, err = -EBADF; goto out; } -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE buf = &st64; #else buf = __stat_buf; @@ -125,7 +125,7 @@ PREPEND(__, SYSIO_INTERFACE_NAME(fxstat))(int __ver, */ err = fil->f_ino->i_ops.inop_getattr(NULL, fil->f_ino, buf); -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE if (!err) convstat(buf, __stat_buf); #endif @@ -186,7 +186,7 @@ PREPEND(__, SYSIO_INTERFACE_NAME(xstat))(int __ver, * the inode are always correct or refresh them in the lookup, above. */ ino = pno->p_base->pb_ino; -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE convstat(&ino->i_stbuf, __stat_buf); #else (void )memcpy(__stat_buf, &ino->i_stbuf, sizeof(struct intnl_stat)); @@ -250,7 +250,7 @@ PREPEND(__, SYSIO_INTERFACE_NAME(lxstat))(int __ver, * the inode are always correct or refresh them in the lookup, above. */ ino = pno->p_base->pb_ino; -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE convstat(&ino->i_stbuf, __stat_buf); #else (void )memcpy(__stat_buf, &ino->i_stbuf, sizeof(struct intnl_stat)); diff --git a/libsysio/src/truncate.c b/libsysio/src/truncate.c index 5846ad3..27ef6b6 100644 --- a/libsysio/src/truncate.c +++ b/libsysio/src/truncate.c @@ -104,7 +104,7 @@ out: SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE #undef truncate64 sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(truncate)), SYSIO_INTERFACE_NAME(truncate64)) @@ -145,7 +145,7 @@ out: SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } -#if _LARGEFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE #undef ftruncate64 sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(ftruncate)), SYSIO_INTERFACE_NAME(ftruncate64)) diff --git a/libsysio/tests/startup.c b/libsysio/tests/startup.c index 764fa05..033b325 100644 --- a/libsysio/tests/startup.c +++ b/libsysio/tests/startup.c @@ -21,7 +21,7 @@ _test_sysio_startup() err = drv_init_all(); if (err) return err; -#if SYSIO_TRACING +#ifdef SYSIO_TRACING /* * tracing */ @@ -43,7 +43,7 @@ _test_sysio_startup() err = _sysio_boot("namespace", arg); if (err) return err; -#if DEFER_INIT_CWD +#ifdef DEFER_INIT_CWD /* * Current working directory. */ -- 1.8.3.1