diff options
author | Nikola Pajkovsky <npajkovs@redhat.com> | 2010-06-01 16:44:49 +0200 |
---|---|---|
committer | Nikola Pajkovsky <npajkovs@redhat.com> | 2010-06-01 16:44:49 +0200 |
commit | b69e4c744b48ed2f70878ccd1535ab9fad2bd959 (patch) | |
tree | eab4c941b25d216ddae4406d40efc6401ca10052 | |
parent | 21bdb298ce46b52e7e9ac997f4f8e6d885832b1e (diff) | |
download | abrt-b69e4c744b48ed2f70878ccd1535ab9fad2bd959.tar.gz abrt-b69e4c744b48ed2f70878ccd1535ab9fad2bd959.tar.xz abrt-b69e4c744b48ed2f70878ccd1535ab9fad2bd959.zip |
add new file *hostname* into debugdump directory
Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
-rw-r--r-- | inc/CrashTypes.h | 1 | ||||
-rw-r--r-- | lib/Utils/make_descr.cpp | 1 | ||||
-rw-r--r-- | src/Daemon/MiddleWare.cpp | 12 |
3 files changed, 14 insertions, 0 deletions
diff --git a/inc/CrashTypes.h b/inc/CrashTypes.h index 4e80f8d9..0581fc5f 100644 --- a/inc/CrashTypes.h +++ b/inc/CrashTypes.h @@ -47,6 +47,7 @@ #define FILENAME_COMMENT "comment" #define FILENAME_REPRODUCE "reproduce" #define FILENAME_RATING "rating" +#define FILENAME_HOSTNAME "hostname" // Apart from CD_UID, which is also stored as a file in dump directory, // these items only exist in db. (CD_UID is also a file because diff --git a/lib/Utils/make_descr.cpp b/lib/Utils/make_descr.cpp index 3eeb4041..7db30bc1 100644 --- a/lib/Utils/make_descr.cpp +++ b/lib/Utils/make_descr.cpp @@ -74,6 +74,7 @@ static const char *const blacklisted_items_bz[] = { FILENAME_ANALYZER , FILENAME_COREDUMP , FILENAME_DESCRIPTION, /* package description - basically useless */ + FILENAME_HOSTNAME , CD_UID , CD_UUID , CD_INFORMALL , diff --git a/src/Daemon/MiddleWare.cpp b/src/Daemon/MiddleWare.cpp index fafe0738..cfec3c47 100644 --- a/src/Daemon/MiddleWare.cpp +++ b/src/Daemon/MiddleWare.cpp @@ -793,6 +793,17 @@ static mw_result_t SavePackageDescriptionToDebugDump( } std::string description = GetDescription(packageName.c_str()); + + // HOST_NAME_MAX is defined in limits.h + char host[HOST_NAME_MAX + 1]; + int ret = gethostname(host, HOST_NAME_MAX); + host[HOST_NAME_MAX] = '\0'; + if (ret < 0) + { + perror_msg("gethostname"); + host[0] = '\0'; + } + try { CDebugDump dd; @@ -800,6 +811,7 @@ static mw_result_t SavePackageDescriptionToDebugDump( dd.SaveText(FILENAME_PACKAGE, package.c_str()); dd.SaveText(FILENAME_DESCRIPTION, description.c_str()); dd.SaveText(FILENAME_COMPONENT, component.c_str()); + dd.SaveText(FILENAME_HOSTNAME, host); } catch (CABRTException& e) { |