From: <n-...@us...> - 2010-05-18 06:18:23
|
Revision: 4678 http://gfarm.svn.sourceforge.net/gfarm/?rev=4678&view=rev Author: n-soda Date: 2010-05-18 06:18:17 +0000 (Tue, 18 May 2010) Log Message: ----------- use __FDS_BITS macro, if defined, no functional change. This changes is for glibc, esp. portability to ${host_os} = "kfreebsd-gnu" or "linux-gnuabi". This change is not necessary on usual Linux, because configre.ac already defines "_GNU_SOURCE" for ${host_os} = "linux_gnu" case. Modified Paths: -------------- gfarm_v2/trunk/lib/libgfarm/gfutil/gfevent.c Modified: gfarm_v2/trunk/lib/libgfarm/gfutil/gfevent.c =================================================================== --- gfarm_v2/trunk/lib/libgfarm/gfutil/gfevent.c 2010-05-17 16:12:46 UTC (rev 4677) +++ gfarm_v2/trunk/lib/libgfarm/gfutil/gfevent.c 2010-05-18 06:18:17 UTC (rev 4678) @@ -19,6 +19,11 @@ #include "gfevent.h" #define MIN_FDS_SIZE FD_SETSIZE +#ifdef __FDS_BITS /* for glibc, esp. Debian/kFreeBSD */ +#define GF_FDS_BITS(set) __FDS_BITS(set) +#else +#define GF_FDS_BITS(set) (set)->fds_bits +#endif /* event */ @@ -203,10 +208,10 @@ * where howmany(x, y) == (((x) + ((y) - 1)) / (y)) */ fds_array_length = gfarm_size_add(&overflow, fds_size, - (sizeof(fsp->fds_bits[0]) * CHAR_BIT) - 1) / - (sizeof(fsp->fds_bits[0]) * CHAR_BIT); + (sizeof(GF_FDS_BITS(fsp)[0]) * CHAR_BIT) - 1) / + (sizeof(GF_FDS_BITS(fsp)[0]) * CHAR_BIT); fds_bytes = gfarm_size_mul(&overflow, - fds_array_length, sizeof(fsp->fds_bits[0])); + fds_array_length, sizeof(GF_FDS_BITS(fsp)[0])); fd_set_size = gfarm_size_mul(&overflow, fds_bytes, CHAR_BIT); if (overflow) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |