Signed-off-by: Jakub Filak <jfilak(a)redhat.com>
---
configure.ac | 2 ++
src/applet/applet.c | 7 ++++---
src/cli/abrt-cli.c | 5 +++++
src/daemon/abrt-action-save-package-data.c | 5 +++++
src/daemon/abrt-handle-event.c | 4 ++++
src/daemon/abrt-server.c | 5 +++++
src/daemon/abrtd.c | 6 +++---
src/dbus/abrt-dbus.c | 3 +++
src/gui-gtk/main.c | 8 +++++---
src/plugins/abrt-action-analyze-backtrace.c | 4 ++++
src/plugins/abrt-action-analyze-c.c | 4 ++++
src/plugins/abrt-action-analyze-oops.c | 3 +++
src/plugins/abrt-action-analyze-python.c | 4 ++++
src/plugins/abrt-action-generate-backtrace.c | 3 +++
src/plugins/abrt-action-generate-core-backtrace.c | 4 ++++
src/plugins/abrt-action-trim-files.c | 4 ++++
src/plugins/abrt-dump-oops.c | 3 +++
src/plugins/abrt-dump-xorg.c | 4 ++++
src/plugins/abrt-watch-log.c | 4 ++++
19 files changed, 73 insertions(+), 9 deletions(-)
diff --git a/configure.ac b/configure.ac
index 987cacd..ed0331e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -96,6 +96,8 @@ AM_CONDITIONAL(HAVE_SYSTEMD, [test -n
"$with_systemdsystemunitdir"])
AC_CHECK_HEADER([sys/inotify.h], [],
[AC_MSG_ERROR([sys/inotify.h is needed to build abrt])])
+AC_CHECK_HEADERS([locale.h])
+
CONF_DIR='${sysconfdir}/${PACKAGE_NAME}'
VAR_RUN='${localstatedir}/run'
PLUGINS_CONF_DIR='${sysconfdir}/${PACKAGE_NAME}/plugins'
diff --git a/src/applet/applet.c b/src/applet/applet.c
index 414ccb3..2c620e7 100644
--- a/src/applet/applet.c
+++ b/src/applet/applet.c
@@ -16,9 +16,6 @@
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#if HAVE_LOCALE_H
-# include <locale.h>
-#endif
#include <gtk/gtk.h>
#include <libnotify/notify.h>
#include <dbus/dbus-shared.h>
@@ -28,6 +25,10 @@
#include <internal_abrt_dbus.h>
#include "libabrt.h"
+#if HAVE_LOCALE_H
+# include <locale.h>
+#endif /* HAVE_LOCALE_H */
+
#define ABRTD_DBUS_NAME "com.redhat.abrt"
#define ABRTD_DBUS_PATH "/com/redhat/abrt"
#define ABRTD_DBUS_IFACE "com.redhat.abrt"
diff --git a/src/cli/abrt-cli.c b/src/cli/abrt-cli.c
index 894ab25..1961bd7 100644
--- a/src/cli/abrt-cli.c
+++ b/src/cli/abrt-cli.c
@@ -18,6 +18,11 @@
*/
#include "libabrt.h"
+
+#if HAVE_LOCALE_H
+# include <locale.h>
+#endif /* HAVE_LOCALE_H */
+
#include "builtin-cmd.h"
#define USAGE_OPTS_WIDTH 12
diff --git a/src/daemon/abrt-action-save-package-data.c
b/src/daemon/abrt-action-save-package-data.c
index f2258d0..13f9512 100644
--- a/src/daemon/abrt-action-save-package-data.c
+++ b/src/daemon/abrt-action-save-package-data.c
@@ -18,6 +18,11 @@
*/
#include <fnmatch.h>
#include "libabrt.h"
+
+#if HAVE_LOCALE_H
+# include <locale.h>
+#endif /* HAVE_LOCALE_H */
+
#include "rpm.h"
static bool settings_bOpenGPGCheck = false;
diff --git a/src/daemon/abrt-handle-event.c b/src/daemon/abrt-handle-event.c
index 58c4a84..cf6d625 100644
--- a/src/daemon/abrt-handle-event.c
+++ b/src/daemon/abrt-handle-event.c
@@ -20,6 +20,10 @@
#include "libabrt.h"
#include "run_event.h"
+#if HAVE_LOCALE_H
+# include <locale.h>
+#endif /* HAVE_LOCALE_H */
+
#include <btparser/frame.h>
#include <btparser/thread.h>
#include <btparser/normalize.h>
diff --git a/src/daemon/abrt-server.c b/src/daemon/abrt-server.c
index 15f3370..0d7dd53 100644
--- a/src/daemon/abrt-server.c
+++ b/src/daemon/abrt-server.c
@@ -18,6 +18,11 @@
#include <syslog.h>
#include "libabrt.h"
+#if HAVE_LOCALE_H
+# include <locale.h>
+#endif /* HAVE_LOCALE_H */
+
+
/* Maximal length of backtrace. */
#define MAX_BACKTRACE_SIZE (1024*1024)
/* Amount of data received from one client for a message before reporting error. */
diff --git a/src/daemon/abrtd.c b/src/daemon/abrtd.c
index e2ace8e..dfa66c8 100644
--- a/src/daemon/abrtd.c
+++ b/src/daemon/abrtd.c
@@ -16,9 +16,6 @@
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#if HAVE_LOCALE_H
-# include <locale.h>
-#endif
#include <sys/un.h>
#include <syslog.h>
#include <sys/inotify.h>
@@ -26,6 +23,9 @@
#include "libabrt.h"
+#if HAVE_LOCALE_H
+# include <locale.h>
+#endif
/* I want to use -Werror, but gcc-4.4 throws a curveball:
* "warning: ignoring return value of 'ftruncate', declared with attribute
warn_unused_result"
diff --git a/src/dbus/abrt-dbus.c b/src/dbus/abrt-dbus.c
index 37c9d69..7a0b0c5 100644
--- a/src/dbus/abrt-dbus.c
+++ b/src/dbus/abrt-dbus.c
@@ -4,6 +4,9 @@
#include <pwd.h>
#include <grp.h>
#include "libabrt.h"
+#if HAVE_LOCALE_H
+# include <locale.h>
+#endif /* HAVE_LOCALE_H */
#include "abrt-polkit.h"
#include "abrt-dbus.h"
#include "dump_dir.h"
diff --git a/src/gui-gtk/main.c b/src/gui-gtk/main.c
index e80d1c7..1e3c13e 100644
--- a/src/gui-gtk/main.c
+++ b/src/gui-gtk/main.c
@@ -20,11 +20,13 @@
#include <gdk/gdkkeysyms.h>
#include <sys/inotify.h>
#include <gio/gio.h> //dbus
-#if HAVE_LOCALE_H
-# include <locale.h>
-#endif
#include <internal_libreport_gtk.h>
#include "libabrt.h"
+
+#if HAVE_LOCALE_H
+# include <locale.h>
+#endif /* HAVE_LOCALE_H */
+
#include "abrt-dbus.h"
#if GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION < 22
diff --git a/src/plugins/abrt-action-analyze-backtrace.c
b/src/plugins/abrt-action-analyze-backtrace.c
index 3333c7e..15f3e29 100644
--- a/src/plugins/abrt-action-analyze-backtrace.c
+++ b/src/plugins/abrt-action-analyze-backtrace.c
@@ -20,6 +20,10 @@
#include <btparser/location.h>
#include "libabrt.h"
+#if HAVE_LOCALE_H
+# include <locale.h>
+#endif /* HAVE_LOCALE_H */
+
static const char *dump_dir_name = ".";
diff --git a/src/plugins/abrt-action-analyze-c.c b/src/plugins/abrt-action-analyze-c.c
index 28ddf4a..53e1420 100644
--- a/src/plugins/abrt-action-analyze-c.c
+++ b/src/plugins/abrt-action-analyze-c.c
@@ -18,6 +18,10 @@
*/
#include "libabrt.h"
+#if HAVE_LOCALE_H
+# include <locale.h>
+#endif /* HAVE_LOCALE_H */
+
static void create_hash(char hash_str[SHA1_RESULT_LEN*2 + 1], const char *pInput)
{
char hash_bytes[SHA1_RESULT_LEN];
diff --git a/src/plugins/abrt-action-analyze-oops.c
b/src/plugins/abrt-action-analyze-oops.c
index 3eb0a61..eb35aae 100644
--- a/src/plugins/abrt-action-analyze-oops.c
+++ b/src/plugins/abrt-action-analyze-oops.c
@@ -18,6 +18,9 @@
*/
#include "libabrt.h"
+#if HAVE_LOCALE_H
+# include <locale.h>
+#endif /* HAVE_LOCALE_H */
int main(int argc, char **argv)
{
diff --git a/src/plugins/abrt-action-analyze-python.c
b/src/plugins/abrt-action-analyze-python.c
index aeab349..9000873 100644
--- a/src/plugins/abrt-action-analyze-python.c
+++ b/src/plugins/abrt-action-analyze-python.c
@@ -18,6 +18,10 @@
*/
#include "libabrt.h"
+#if HAVE_LOCALE_H
+# include <locale.h>
+#endif /* HAVE_LOCALE_H */
+
int main(int argc, char **argv)
{
/* I18n */
diff --git a/src/plugins/abrt-action-generate-backtrace.c
b/src/plugins/abrt-action-generate-backtrace.c
index 71be7d1..16a4674 100644
--- a/src/plugins/abrt-action-generate-backtrace.c
+++ b/src/plugins/abrt-action-generate-backtrace.c
@@ -18,6 +18,9 @@
*/
#include "libabrt.h"
+#if HAVE_LOCALE_H
+# include <locale.h>
+#endif /* HAVE_LOCALE_H */
static const char *dump_dir_name = ".";
/* 60 seconds was too limiting on slow machines */
diff --git a/src/plugins/abrt-action-generate-core-backtrace.c
b/src/plugins/abrt-action-generate-core-backtrace.c
index f6640b3..b6fee14 100644
--- a/src/plugins/abrt-action-generate-core-backtrace.c
+++ b/src/plugins/abrt-action-generate-core-backtrace.c
@@ -18,6 +18,10 @@
*/
#include "libabrt.h"
+#if HAVE_LOCALE_H
+# include <locale.h>
+#endif /* HAVE_LOCALE_H */
+
#ifdef ENABLE_DISASSEMBLY
#include <libelf.h>
#include <gelf.h>
diff --git a/src/plugins/abrt-action-trim-files.c b/src/plugins/abrt-action-trim-files.c
index 78c7cd3..8ed6972 100644
--- a/src/plugins/abrt-action-trim-files.c
+++ b/src/plugins/abrt-action-trim-files.c
@@ -18,6 +18,10 @@
*/
#include "libabrt.h"
+#if HAVE_LOCALE_H
+# include <locale.h>
+#endif /* HAVE_LOCALE_H */
+
/* We remember N worst files and their sizes, not just one:
* if DIR is deep, scanning it takes *a few seconds* even if it's in cache.
* If we rescan it after each single file deletion, it can be VERY slow.
diff --git a/src/plugins/abrt-dump-oops.c b/src/plugins/abrt-dump-oops.c
index cd4ef70..9c5b019 100644
--- a/src/plugins/abrt-dump-oops.c
+++ b/src/plugins/abrt-dump-oops.c
@@ -19,6 +19,9 @@
#include <syslog.h>
#include "libabrt.h"
+#if HAVE_LOCALE_H
+# include <locale.h>
+#endif /* HAVE_LOCALE_H */
static bool world_readable_dump = false;
static const char *debug_dumps_dir = ".";
diff --git a/src/plugins/abrt-dump-xorg.c b/src/plugins/abrt-dump-xorg.c
index a548732..b59b2fe 100644
--- a/src/plugins/abrt-dump-xorg.c
+++ b/src/plugins/abrt-dump-xorg.c
@@ -19,6 +19,10 @@
#include <syslog.h>
#include "libabrt.h"
+#if HAVE_LOCALE_H
+# include <locale.h>
+#endif /* HAVE_LOCALE_H */
+
/* I want to use -Werror, but gcc-4.4 throws a curveball:
* "warning: ignoring return value of 'ftruncate', declared with attribute
warn_unused_result"
* and (void) cast is not enough to shut it up! Oh God...
diff --git a/src/plugins/abrt-watch-log.c b/src/plugins/abrt-watch-log.c
index 0b15eee..dbe8a98 100644
--- a/src/plugins/abrt-watch-log.c
+++ b/src/plugins/abrt-watch-log.c
@@ -20,6 +20,10 @@
#include <sys/inotify.h>
#include "libabrt.h"
+#if HAVE_LOCALE_H
+# include <locale.h>
+#endif /* HAVE_LOCALE_H */
+
#define MAX_SCAN_BLOCK (4*1024*1024)
#define READ_AHEAD (10*1024)
--
1.7.7.6