|
|
d9e469 |
From d7453479e96693ebb5e17b285adf915b67095aad Mon Sep 17 00:00:00 2001
|
|
|
d9e469 |
From: Jakub Filak <jfilak@redhat.com>
|
|
|
d9e469 |
Date: Wed, 2 Apr 2014 15:03:44 +0200
|
|
|
d9e469 |
Subject: [PATCH 31/32] Correct ABRT report data
|
|
|
d9e469 |
|
|
|
d9e469 |
Remove '\0' byte from 'PUT' message because this was superfluous.
|
|
|
d9e469 |
|
|
|
d9e469 |
Replaced 'BASENAME' item with 'TYPE' item because the first one is no
|
|
|
d9e469 |
longer supported by abrtd and the second one is required. Basically the
|
|
|
d9e469 |
later is a substitute for the first one.
|
|
|
d9e469 |
|
|
|
d9e469 |
Removed the closing message which is not supported by abrtd. abrtd
|
|
|
d9e469 |
considers that message as a part of the problem report.
|
|
|
d9e469 |
|
|
|
d9e469 |
Removed a superfluous space from 'Backtrace'.
|
|
|
d9e469 |
|
|
|
d9e469 |
Signed-off-by: Jakub Filak <jfilak@redhat.com>
|
|
|
d9e469 |
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
|
|
|
d9e469 |
---
|
|
|
d9e469 |
ras-report.c | 41 ++++-------------------------------------
|
|
|
d9e469 |
1 files changed, 4 insertions(+), 37 deletions(-)
|
|
|
d9e469 |
|
|
|
d9e469 |
diff --git a/ras-report.c b/ras-report.c
|
|
|
d9e469 |
index d3e4a79..0a05732 100644
|
|
|
d9e469 |
--- a/ras-report.c
|
|
|
d9e469 |
+++ b/ras-report.c
|
|
|
d9e469 |
@@ -51,8 +51,8 @@ static int commit_report_basic(int sockfd){
|
|
|
d9e469 |
* ABRT server protocol
|
|
|
d9e469 |
*/
|
|
|
d9e469 |
sprintf(buf, "PUT / HTTP/1.1\r\n\r\n");
|
|
|
d9e469 |
- rc = write(sockfd, buf, strlen(buf) + 1);
|
|
|
d9e469 |
- if(rc < strlen(buf) + 1){
|
|
|
d9e469 |
+ rc = write(sockfd, buf, strlen(buf));
|
|
|
d9e469 |
+ if(rc < strlen(buf)){
|
|
|
d9e469 |
return -1;
|
|
|
d9e469 |
}
|
|
|
d9e469 |
|
|
|
d9e469 |
@@ -68,7 +68,7 @@ static int commit_report_basic(int sockfd){
|
|
|
d9e469 |
return -1;
|
|
|
d9e469 |
}
|
|
|
d9e469 |
|
|
|
d9e469 |
- sprintf(buf, "BASENAME=%s", "rasdaemon");
|
|
|
d9e469 |
+ sprintf(buf, "TYPE=%s", "ras");
|
|
|
d9e469 |
rc = write(sockfd, buf, strlen(buf) + 1);
|
|
|
d9e469 |
if(rc < strlen(buf) + 1){
|
|
|
d9e469 |
return -1;
|
|
|
d9e469 |
@@ -77,31 +77,13 @@ static int commit_report_basic(int sockfd){
|
|
|
d9e469 |
return 0;
|
|
|
d9e469 |
}
|
|
|
d9e469 |
|
|
|
d9e469 |
-/*
|
|
|
d9e469 |
- * add "DONE" string to finish message.
|
|
|
d9e469 |
- */
|
|
|
d9e469 |
-static int commit_report_done(int sockfd){
|
|
|
d9e469 |
- int rc = -1;
|
|
|
d9e469 |
-
|
|
|
d9e469 |
- if(sockfd < 0){
|
|
|
d9e469 |
- return -1;
|
|
|
d9e469 |
- }
|
|
|
d9e469 |
-
|
|
|
d9e469 |
- rc = write(sockfd, "DONE\0", strlen("DONE\0"));
|
|
|
d9e469 |
- if(rc < strlen("DONE\0")){
|
|
|
d9e469 |
- return -1;
|
|
|
d9e469 |
- }
|
|
|
d9e469 |
-
|
|
|
d9e469 |
- return 0;
|
|
|
d9e469 |
-}
|
|
|
d9e469 |
-
|
|
|
d9e469 |
static int set_mc_event_backtrace(char *buf, struct ras_mc_event *ev){
|
|
|
d9e469 |
char bt_buf[MAX_BACKTRACE_SIZE];
|
|
|
d9e469 |
|
|
|
d9e469 |
if(!buf || !ev)
|
|
|
d9e469 |
return -1;
|
|
|
d9e469 |
|
|
|
d9e469 |
- sprintf(bt_buf, "BACKTRACE= " \
|
|
|
d9e469 |
+ sprintf(bt_buf, "BACKTRACE=" \
|
|
|
d9e469 |
"timestamp=%s\n" \
|
|
|
d9e469 |
"error_count=%d\n" \
|
|
|
d9e469 |
"error_type=%s\n" \
|
|
|
d9e469 |
@@ -298,11 +280,6 @@ int ras_report_mc_event(struct ras_events *ras, struct ras_mc_event *ev){
|
|
|
d9e469 |
goto mc_fail;
|
|
|
d9e469 |
}
|
|
|
d9e469 |
|
|
|
d9e469 |
- rc = commit_report_done(sockfd);
|
|
|
d9e469 |
- if(rc < 0){
|
|
|
d9e469 |
- goto mc_fail;
|
|
|
d9e469 |
- }
|
|
|
d9e469 |
-
|
|
|
d9e469 |
done = 1;
|
|
|
d9e469 |
|
|
|
d9e469 |
mc_fail:
|
|
|
d9e469 |
@@ -353,11 +330,6 @@ int ras_report_aer_event(struct ras_events *ras, struct ras_aer_event *ev){
|
|
|
d9e469 |
goto aer_fail;
|
|
|
d9e469 |
}
|
|
|
d9e469 |
|
|
|
d9e469 |
- rc = commit_report_done(sockfd);
|
|
|
d9e469 |
- if(rc < 0){
|
|
|
d9e469 |
- goto aer_fail;
|
|
|
d9e469 |
- }
|
|
|
d9e469 |
-
|
|
|
d9e469 |
done = 1;
|
|
|
d9e469 |
|
|
|
d9e469 |
aer_fail:
|
|
|
d9e469 |
@@ -408,11 +380,6 @@ int ras_report_mce_event(struct ras_events *ras, struct mce_event *ev){
|
|
|
d9e469 |
goto mce_fail;
|
|
|
d9e469 |
}
|
|
|
d9e469 |
|
|
|
d9e469 |
- rc = commit_report_done(sockfd);
|
|
|
d9e469 |
- if(rc < 0){
|
|
|
d9e469 |
- goto mce_fail;
|
|
|
d9e469 |
- }
|
|
|
d9e469 |
-
|
|
|
d9e469 |
done = 1;
|
|
|
d9e469 |
|
|
|
d9e469 |
mce_fail:
|
|
|
d9e469 |
--
|
|
|
d9e469 |
1.7.1
|
|
|
d9e469 |
|