summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d4dde37)
raw | patch | inline | side by side (parent: d4dde37)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Tue, 5 May 2009 18:15:35 +0000 (20:15 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Tue, 5 May 2009 18:15:35 +0000 (20:15 +0200) |
On Debian GNU/Linux (testing) this works. Let's see how other
systems hold up.
systems hold up.
14 files changed:
configure.in | patch | blob | history | |
src/Makefile.am | patch | blob | history | |
src/collectd-nagios.c | patch | blob | history | |
src/collectd.h | patch | blob | history | |
src/dns.c | patch | blob | history | |
src/exec.c | patch | blob | history | |
src/iptables.c | patch | blob | history | |
src/libcollectdclient/client.c | patch | blob | history | |
src/load.c | patch | blob | history | |
src/memcached.c | patch | blob | history | |
src/network.c | patch | blob | history | |
src/ntpd.c | patch | blob | history | |
src/standards.h | [deleted file] | patch | blob | history |
src/utils_dns.c | patch | blob | history |
diff --git a/configure.in b/configure.in
index 45b8869ddcb32b7f633d47796273ccd52b735fd3..115ee21d193443fff95a34090cd0584dac5108d3 100644 (file)
--- a/configure.in
+++ b/configure.in
if test "x$ac_system" = "xSolaris"
then
- CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
+ AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Define to enforce POSIX thread semantics under Solaris.])
fi
# Where to install .pc files.
pkgconfigdir="${libdir}/pkgconfig"
AC_SUBST(pkgconfigdir)
+# Check for standards compliance mode
+AC_ARG_ENABLE(standards,
+ AS_HELP_STRING([--enable-standards], [Enable standards compliance mode]),
+ [enable_standards="$enableval"],
+ [enable_standards="no"])
+if test "x$enable_standards" = "xyes"
+then
+ AC_DEFINE(_ISOC99_SOURCE, 1, [Define to enforce ISO C99 compliance.])
+ AC_DEFINE(_POSIX_C_SOURCE, 200112L, [Define to enforce POSIX.1-2001 compliance.])
+ AC_DEFINE(_XOPEN_SOURCE, 600, [Define to enforce X/Open 6 (XSI) compliance.])
+ AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
+fi
+AM_CONDITIONAL(BUILD_FEATURE_STANDARDS, test "x$enable_standards" = "xyes")
+
#
# Checks for header files.
#
#endif
])
-AC_CHECK_HEADERS(pwd.h grp.h sys/un.h ctype.h limits.h sys/quota.h xfs/xqm.h fs_info.h fshelp.h paths.h mntent.h mnttab.h sys/fstyp.h sys/fs_types.h sys/mntent.h sys/mnttab.h sys/statfs.h sys/statvfs.h sys/vfs.h sys/vfstab.h kvm.h wordexp.h)
+AC_CHECK_HEADERS(pwd.h grp.h sys/un.h ctype.h limits.h xfs/xqm.h fs_info.h fshelp.h paths.h mntent.h mnttab.h sys/fstyp.h sys/fs_types.h sys/mntent.h sys/mnttab.h sys/statfs.h sys/statvfs.h sys/vfs.h sys/vfstab.h kvm.h wordexp.h)
# For the dns plugin
AC_CHECK_HEADERS(arpa/nameser.h)
])
AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
-[#if HAVE_STDINT_H
+[#define _BSD_SOURCE
+#if HAVE_STDINT_H
# include <stdint.h>
#endif
#if HAVE_SYS_TYPES_H
#endif
])
AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
-[#if HAVE_STDINT_H
+[#define _BSD_SOURCE
+#if HAVE_STDINT_H
# include <stdint.h>
#endif
#if HAVE_SYS_TYPES_H
# FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
AC_COLLECTD([debug], [enable], [feature], [debugging])
AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
-AC_COLLECTD([standards], [enable], [feature], [enable strict standards compliance mode])
AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
dependency_error="no"
diff --git a/src/Makefile.am b/src/Makefile.am
index 9c0b8e9a59bfaccaa520a238a6161ec8e9126150..489673656c829b442d157db3b59ec61c18b5e22c 100644 (file)
--- a/src/Makefile.am
+++ b/src/Makefile.am
utils_tail.c utils_tail.h \
utils_threshold.c utils_threshold.h \
types_list.c types_list.h
-if BUILD_FEATURE_STANDARDS
-collectd_SOURCES += standards.h
-endif
collectd_CPPFLAGS = $(AM_CPPFLAGS) $(LTDLINCL)
collectd_CFLAGS = $(AM_CFLAGS)
diff --git a/src/collectd-nagios.c b/src/collectd-nagios.c
index 0c480a06ea90fe5a823bc2d77b31fd1338ccb8c7..29e34a4ce5a413c4af48037aade685fb1616b267 100644 (file)
--- a/src/collectd-nagios.c
+++ b/src/collectd-nagios.c
# include "config.h"
#endif
-/* Set to C99 and POSIX code */
-#if COLLECT_STANDARDS
-# include "standards.h"
-#endif /* COLLECT_STANDARDS */
-
#if !defined(__GNUC__) || !__GNUC__
# define __attribute__(x) /**/
#endif
diff --git a/src/collectd.h b/src/collectd.h
index 5a039199730253d4633796d3697af3568c2927c2..18052ba3980130caa048b3b5768de5915c0f9f93 100644 (file)
--- a/src/collectd.h
+++ b/src/collectd.h
# include "config.h"
#endif
-/* Set to C99 and POSIX code */
-#if COLLECT_STANDARDS
-# include "standards.h"
-#endif /* COLLECT_STANDARDS */
-
#include <stdio.h>
#if HAVE_SYS_TYPES_H
# include <sys/types.h>
diff --git a/src/dns.c b/src/dns.c
index 476b6ddb2a2effded68e76af34152b20a634df51..8339377b2dbb82babf8773e6d00a1c2c0513cce1 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
* Florian octo Forster <octo at verplant.org>
**/
+#define _BSD_SOURCE
+
#include "collectd.h"
#include "common.h"
#include "plugin.h"
diff --git a/src/exec.c b/src/exec.c
index d2b2508db209b87fb302ec35dee558016e01cabb..4405985646fdf24d27e3ea25367e32965cb47ee7 100644 (file)
--- a/src/exec.c
+++ b/src/exec.c
* Peter Holik <peter at holik.at>
**/
+#define _BSD_SOURCE /* For setgroups */
+
#include "collectd.h"
#include "common.h"
#include "plugin.h"
diff --git a/src/iptables.c b/src/iptables.c
index 3062a0cd400ae48dad430efdd9a831aab2500a69..6f1030fb374549c04983ced5a65aae51db2aa9e5 100644 (file)
--- a/src/iptables.c
+++ b/src/iptables.c
#include "plugin.h"
#include "configfile.h"
+#include <sys/socket.h>
+
#if OWN_LIBIPTC
# include "libiptc/libiptc.h"
# include "libiptc/libip6tc.h"
index 134a5c4d52cf012d2c570294e7eb6c59de00f390..e90b3b007cb73ac8f35a174bc64c5ef648b2d731 100644 (file)
# include "config.h"
#endif
-/* Set to C99 and POSIX code */
-#if COLLECT_STANDARDS
-# include "standards.h"
-#endif /* COLLECT_STANDARDS */
-
#if !defined(__GNUC__) || !__GNUC__
# define __attribute__(x) /**/
#endif
diff --git a/src/load.c b/src/load.c
index b7372a1091f9e35e7ffc597570129dc3cb636c2a..cf5221b278a425688845df5e9ff75b30b6e05501 100644 (file)
--- a/src/load.c
+++ b/src/load.c
* Florian octo Forster <octo at verplant.org>
**/
+#define _BSD_SOURCE
+
#include "collectd.h"
#include "common.h"
#include "plugin.h"
diff --git a/src/memcached.c b/src/memcached.c
index 3421f824f0cfed67b1173dccc263c4f7021ccd72..06cf2001b6287adb49b8843fc69994f962ae1c65 100644 (file)
--- a/src/memcached.c
+++ b/src/memcached.c
memset (&serv_addr, 0, sizeof (serv_addr));
serv_addr.sun_family = AF_UNIX;
- sstrncpy (serv_addr.sun_path, memcached_socket, sizeof (serv_addr.sun_path));
+ sstrncpy (serv_addr.sun_path, memcached_socket,
+ sizeof (serv_addr.sun_path));
/* create our socket descriptor */
fd = socket (AF_UNIX, SOCK_STREAM, 0);
/* connect to the memcached daemon */
status = (ssize_t) connect (fd, (struct sockaddr *) &serv_addr,
- SUN_LEN (&serv_addr));
+ sizeof (serv_addr));
if (status != 0) {
shutdown (fd, SHUT_RDWR);
close (fd);
diff --git a/src/network.c b/src/network.c
index 67a7c3c57b5db7e9059b5769520c34b9dcb8f1e0..274d2d8248c66d46a3bfc992a87007ea13d6f68e 100644 (file)
--- a/src/network.c
+++ b/src/network.c
* Florian octo Forster <octo at verplant.org>
**/
+#define _BSD_SOURCE /* For struct ip_mreq */
+
#include "collectd.h"
#include "plugin.h"
#include "common.h"
diff --git a/src/ntpd.c b/src/ntpd.c
index f51ef5aee72aad3f2c8fd8ba88a4ba2bc4ddda24..9d716adc0e0e181f3c965107c32e06670dfa97f4 100644 (file)
--- a/src/ntpd.c
+++ b/src/ntpd.c
* Florian octo Forster <octo at verplant.org>
**/
+#define _BSD_SOURCE /* For NI_MAXHOST */
+
#include "collectd.h"
#include "common.h"
#include "plugin.h"
diff --git a/src/standards.h b/src/standards.h
--- a/src/standards.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * collectd - src/collectd.h
- * Copyright (C) 2009 Florian octo Forster
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; only version 2 of the License is applicable.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Authors:
- * Florian octo Forster <octo at verplant.org>
- **/
-
-#ifndef COLLECTD_STANDARDS_H
-#define COLLECTD_STANDARDS_H 1
-
-# ifndef _ISOC99_SOURCE
-# define _ISOC99_SOURCE
-# endif
-# ifndef _POSIX_SOURCE
-# define _POSIX_SOURCE
-# endif
-# ifndef _POSIX_C_SOURCE
-# define _POSIX_C_SOURCE 200112L
-# endif
-# ifndef _XOPEN_SOURCE
-# define _XOPEN_SOURCE 600
-# endif
-# ifndef _REENTRANT
-# define _REENTRANT
-# endif
-
-#if 0
-/* Disable non-standard extensions */
-# ifdef _BSD_SOURCE
-# undef _BSD_SOURCE
-# endif
-# ifdef _SVID_SOURCE
-# undef _SVID_SOURCE
-# endif
-# ifdef _GNU_SOURCE
-# undef _GNU_SOURCE
-# endif
-#endif /* 0 */
-
-#endif /* COLLECTD_STANDARDS_H */
diff --git a/src/utils_dns.c b/src/utils_dns.c
index b7dc79134ab6e48db7c8fcdc54a067c6061858de..2348be24db05d55c5b1d6b6ad000ce8108594701 100644 (file)
--- a/src/utils_dns.c
+++ b/src/utils_dns.c
* Florian octo Forster <octo at verplant.org>
*/
+#define _BSD_SOURCE
+
#include "collectd.h"
#include "plugin.h"
#include "common.h"