build fixes + few forgotten patches
This commit is contained in:
parent
cecd7ef849
commit
891ef46da3
@ -1,7 +1,7 @@
|
||||
From 3e39d5b9944536a6f4d4f266b3c4961ad8da443e Mon Sep 17 00:00:00 2001
|
||||
From: Jiri <moskovcak@gmail.com>
|
||||
Date: Wed, 7 Dec 2011 10:34:27 +0100
|
||||
Subject: [PATCH 2/2] disabled reporting to kerneloops.org
|
||||
Subject: [PATCH 2/5] disabled reporting to kerneloops.org
|
||||
|
||||
- we get lot of complains about dead kerneloops.org and since it's
|
||||
not wihtin our power to fix it -> disable it!
|
||||
|
@ -0,0 +1,90 @@
|
||||
From c138894ba3f3e630d7e1af398fcd93ffa862659d Mon Sep 17 00:00:00 2001
|
||||
From: Denys Vlasenko <dvlasenk@redhat.com>
|
||||
Date: Wed, 7 Dec 2011 13:58:25 +0100
|
||||
Subject: [PATCH 3/5] abrtd: fix potential problem with exitcode check on
|
||||
"post-create"
|
||||
|
||||
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
|
||||
---
|
||||
src/daemon/abrtd.c | 53 ++++++++++++++++++++++++++-------------------------
|
||||
1 files changed, 27 insertions(+), 26 deletions(-)
|
||||
|
||||
diff --git a/src/daemon/abrtd.c b/src/daemon/abrtd.c
|
||||
index d3a759a..743e40f 100644
|
||||
--- a/src/daemon/abrtd.c
|
||||
+++ b/src/daemon/abrtd.c
|
||||
@@ -313,9 +313,10 @@ static mw_result_t run_post_create_and_load_data(const char *dump_dir_name, prob
|
||||
/* Prevent having zombie child process */
|
||||
int status;
|
||||
safe_waitpid(child, &status, 0);
|
||||
- status = WEXITSTATUS(status);
|
||||
+ /* status = WEXITSTATUS(status); - wrong, we need to check WIFEXITED too */
|
||||
|
||||
- /* exit 0 means, this is a good, non-dup dir */
|
||||
+ /* exit 0 means "this is a good, non-dup dir" */
|
||||
+ /* exit with 1 + "DUP_OF_DIR: dir" string => dup */
|
||||
if (status != 0)
|
||||
{
|
||||
if (!dup_of_dir)
|
||||
@@ -330,34 +331,34 @@ static mw_result_t run_post_create_and_load_data(const char *dump_dir_name, prob
|
||||
* else: MW_ERROR
|
||||
*/
|
||||
mw_result_t res = MW_ERROR;
|
||||
+ struct dump_dir *dd = dd_opendir(dump_dir_name, /*flags:*/ 0);
|
||||
+ if (!dd)
|
||||
+ /* dd_opendir already emitted error msg */
|
||||
+ goto ret;
|
||||
+
|
||||
+ /* Reset mode/uig/gid to correct values for all files created by event run */
|
||||
+ dd_sanitize_mode_and_owner(dd);
|
||||
+
|
||||
+ /* Update count */
|
||||
+ char *count_str = dd_load_text_ext(dd, FILENAME_COUNT, DD_FAIL_QUIETLY_ENOENT);
|
||||
+ unsigned long count = strtoul(count_str, NULL, 10);
|
||||
+ count++;
|
||||
+ char new_count_str[sizeof(long)*3 + 2];
|
||||
+ sprintf(new_count_str, "%lu", count);
|
||||
+ dd_save_text(dd, FILENAME_COUNT, new_count_str);
|
||||
+ dd_close(dd);
|
||||
+
|
||||
+ *problem_data = load_problem_data(dump_dir_name);
|
||||
+ if (*problem_data != NULL)
|
||||
{
|
||||
- struct dump_dir *dd = dd_opendir(dump_dir_name, /*flags:*/ 0);
|
||||
- if (!dd)
|
||||
- goto ret;
|
||||
-
|
||||
- /* Reset mode/uig/gid to correct values for all files created by event run */
|
||||
- dd_sanitize_mode_and_owner(dd);
|
||||
-
|
||||
- /* Update count */
|
||||
- char *count_str = dd_load_text_ext(dd, FILENAME_COUNT, DD_FAIL_QUIETLY_ENOENT);
|
||||
- unsigned long count = strtoul(count_str, NULL, 10);
|
||||
- count++;
|
||||
- char new_count_str[sizeof(long)*3 + 2];
|
||||
- sprintf(new_count_str, "%lu", count);
|
||||
- dd_save_text(dd, FILENAME_COUNT, new_count_str);
|
||||
- dd_close(dd);
|
||||
-
|
||||
- *problem_data = load_problem_data(dump_dir_name);
|
||||
- if (*problem_data != NULL)
|
||||
+ res = MW_OK;
|
||||
+ if (count > 1)
|
||||
{
|
||||
- res = MW_OK;
|
||||
- if (count > 1)
|
||||
- {
|
||||
- log("Problem directory is a duplicate of %s", dump_dir_name);
|
||||
- res = MW_OCCURRED;
|
||||
- }
|
||||
+ log("Problem directory is a duplicate of %s", dump_dir_name);
|
||||
+ res = MW_OCCURRED;
|
||||
}
|
||||
}
|
||||
+ /* else: load_problem_data already emitted error msg */
|
||||
|
||||
ret:
|
||||
free(dup_of_dir);
|
||||
--
|
||||
1.7.7.3
|
||||
|
@ -0,0 +1,47 @@
|
||||
From 26a0f776d32d0d5be2e15abe781adf5a830c24cc Mon Sep 17 00:00:00 2001
|
||||
From: Denys Vlasenko <dvlasenk@redhat.com>
|
||||
Date: Wed, 7 Dec 2011 14:14:56 +0100
|
||||
Subject: [PATCH 4/5] abrtd: always explain why we delete "corrupted" dir.
|
||||
Closes rhbz#706131.
|
||||
|
||||
We were almost always explaining it, except for the case when
|
||||
'post-create' was failing silently.
|
||||
|
||||
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
|
||||
---
|
||||
src/daemon/abrtd.c | 12 +++++++++++-
|
||||
1 files changed, 11 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/src/daemon/abrtd.c b/src/daemon/abrtd.c
|
||||
index 743e40f..b5c3d4b 100644
|
||||
--- a/src/daemon/abrtd.c
|
||||
+++ b/src/daemon/abrtd.c
|
||||
@@ -313,14 +313,24 @@ static mw_result_t run_post_create_and_load_data(const char *dump_dir_name, prob
|
||||
/* Prevent having zombie child process */
|
||||
int status;
|
||||
safe_waitpid(child, &status, 0);
|
||||
- /* status = WEXITSTATUS(status); - wrong, we need to check WIFEXITED too */
|
||||
|
||||
/* exit 0 means "this is a good, non-dup dir" */
|
||||
/* exit with 1 + "DUP_OF_DIR: dir" string => dup */
|
||||
if (status != 0)
|
||||
{
|
||||
+ if (WIFSIGNALED(status))
|
||||
+ {
|
||||
+ log("'post-create' on '%s' killed by signal %d",
|
||||
+ dump_dir_name, WTERMSIG(status));
|
||||
+ return MW_ERROR;
|
||||
+ }
|
||||
+ /* else: it is WIFEXITED(status) */
|
||||
if (!dup_of_dir)
|
||||
+ {
|
||||
+ log("'post-create' on '%s' exited with %d",
|
||||
+ dump_dir_name, WEXITSTATUS(status));
|
||||
return MW_ERROR;
|
||||
+ }
|
||||
dump_dir_name = dup_of_dir;
|
||||
}
|
||||
|
||||
--
|
||||
1.7.7.3
|
||||
|
48
0005-more-glib2.31-fixes.patch
Normal file
48
0005-more-glib2.31-fixes.patch
Normal file
@ -0,0 +1,48 @@
|
||||
From 2e941ae3c1d13968bda8bb4594a5aa566aa2e5dd Mon Sep 17 00:00:00 2001
|
||||
From: Jiri Moskovcak <jmoskovc@redhat.com>
|
||||
Date: Wed, 7 Dec 2011 16:12:28 +0100
|
||||
Subject: [PATCH 5/5] more glib2.31 fixes
|
||||
|
||||
---
|
||||
src/daemon/abrtd.c | 17 +++++++++++++----
|
||||
1 files changed, 13 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/daemon/abrtd.c b/src/daemon/abrtd.c
|
||||
index d3a759a..3d71e80 100644
|
||||
--- a/src/daemon/abrtd.c
|
||||
+++ b/src/daemon/abrtd.c
|
||||
@@ -238,7 +238,7 @@ static gboolean handle_signal_cb(GIOChannel *gio, GIOCondition condition, gpoint
|
||||
{
|
||||
uint8_t signo;
|
||||
gsize len = 0;
|
||||
- g_io_channel_read(gio, (void*) &signo, 1, &len);
|
||||
+ g_io_channel_read_chars(gio, (void*) &signo, 1, &len, NULL);
|
||||
if (len == 1)
|
||||
{
|
||||
/* we did receive a signal */
|
||||
@@ -382,10 +382,19 @@ static gboolean handle_inotify_cb(GIOChannel *gio, GIOCondition condition, gpoin
|
||||
char *buf = (char*)xmalloc(inotify_bytes);
|
||||
errno = 0;
|
||||
gsize len;
|
||||
- GIOError err = g_io_channel_read(gio, buf, inotify_bytes, &len);
|
||||
- if (err != G_IO_ERROR_NONE)
|
||||
+ GError *gerror = NULL;
|
||||
+ g_io_channel_set_encoding(gio, NULL, &gerror);
|
||||
+ /* need to set the encoding otherwise we get:
|
||||
+ * Invalid byte sequence in conversion input
|
||||
+ * according to manual "NULL" is safe for binary data
|
||||
+ */
|
||||
+ if (gerror)
|
||||
+ perror_msg("Can't set encoding on gio channel: '%s'", gerror->message);
|
||||
+
|
||||
+ GIOStatus err = g_io_channel_read_chars(gio, buf, inotify_bytes, &len, &gerror);
|
||||
+ if (err != G_IO_STATUS_NORMAL)
|
||||
{
|
||||
- perror_msg("Error reading inotify fd");
|
||||
+ perror_msg("Error reading inotify fd: %s", gerror ? gerror->message : "unknown");
|
||||
free(buf);
|
||||
return FALSE; /* "remove this event" (huh??) */
|
||||
}
|
||||
--
|
||||
1.7.7.3
|
||||
|
25
0006-missed-one-more-deprecated-g_io_channel_read.patch
Normal file
25
0006-missed-one-more-deprecated-g_io_channel_read.patch
Normal file
@ -0,0 +1,25 @@
|
||||
From 7b937c6322c3130d9801596b93866a5e72a6da64 Mon Sep 17 00:00:00 2001
|
||||
From: Jiri Moskovcak <jmoskovc@redhat.com>
|
||||
Date: Wed, 7 Dec 2011 16:29:03 +0100
|
||||
Subject: [PATCH 6/6] missed one more deprecated g_io_channel_read
|
||||
|
||||
---
|
||||
src/daemon/abrt-dbus.c | 2 +-
|
||||
1 files changed, 1 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/src/daemon/abrt-dbus.c b/src/daemon/abrt-dbus.c
|
||||
index 756076a..16c01d0 100644
|
||||
--- a/src/daemon/abrt-dbus.c
|
||||
+++ b/src/daemon/abrt-dbus.c
|
||||
@@ -284,7 +284,7 @@ static gboolean handle_signal_cb(GIOChannel *gio, GIOCondition condition, gpoint
|
||||
{
|
||||
uint8_t signo;
|
||||
gsize len = 0;
|
||||
- g_io_channel_read(gio, (void*) &signo, 1, &len);
|
||||
+ g_io_channel_read_chars(gio, (void*) &signo, 1, &len, NULL);
|
||||
if (len == 1)
|
||||
{
|
||||
/* we did receive a signal */
|
||||
--
|
||||
1.7.7.3
|
||||
|
12
abrt.spec
12
abrt.spec
@ -24,7 +24,11 @@ Source: https://fedorahosted.org/released/%{name}/%{name}-%{version}.tar.gz
|
||||
Source1: abrt1_to_abrt2
|
||||
Patch0: blacklist.patch
|
||||
Patch1: abrt_disable_gpgcheck.diff
|
||||
Patch2: 0002-disabled-reporting-to-kerneloops.org.patch
|
||||
Patch3: 0002-disabled-reporting-to-kerneloops.org.patch
|
||||
Patch4: 0003-abrtd-fix-potential-problem-with-exitcode-check-on-p.patch
|
||||
Patch5: 0004-abrtd-always-explain-why-we-delete-corrupted-dir.-Cl.patch
|
||||
Patch6: 0005-more-glib2.31-fixes.patch
|
||||
Patch7: 0006-missed-one-more-deprecated-g_io_channel_read.patch
|
||||
BuildRequires: dbus-devel
|
||||
BuildRequires: gtk2-devel
|
||||
BuildRequires: rpm-devel >= 4.6
|
||||
@ -186,7 +190,11 @@ Virtual package to make easy default installation on desktop environments.
|
||||
%patch0 -p1 -b .blacklist
|
||||
# general
|
||||
%patch1 -p1 -b .gpg
|
||||
%patch2 -p1 -b .disable_koops_org
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
%patch6 -p1
|
||||
%patch7 -p1
|
||||
|
||||
%build
|
||||
autoconf
|
||||
|
Loading…
Reference in New Issue
Block a user