X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fzone.c;h=188fbe3db3dc89108eb9ef45431d7aabb9108d58;hb=edb3002086ef96755804b2d155728cb9a0428935;hp=b8cc9197c2de5eea70990a1e4209b7f284a8d292;hpb=2d4ef8aa6e7c9e2139b2bd2e22d790948980d62b;p=collectd.git diff --git a/src/zone.c b/src/zone.c index b8cc9197..188fbe3d 100644 --- a/src/zone.c +++ b/src/zone.c @@ -20,7 +20,15 @@ * Dagobert Michelsen (forward-porting) **/ -#define _BSD_SOURCE +#if HAVE_CONFIG_H +# include "config.h" +# undef HAVE_CONFIG_H +#endif +/* avoid procfs.h error "Cannot use procfs in the large file compilation environment" */ +#if !defined(_LP64) && _FILE_OFFSET_BITS == 64 +# undef _FILE_OFFSET_BITS +# undef _LARGEFILE64_SOURCE +#endif #include "collectd.h" #include "common.h" @@ -155,7 +163,8 @@ zone_scandir(DIR *procdir) return(NULL); } - for (rewinddir(procdir); (direntp = readdir(procdir)); ) { + rewinddir(procdir); + while ((direntp = readdir(procdir))) { pidstr = direntp->d_name; if (pidstr[0] == '.') /* skip "." and ".." */ continue;