diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-07-22 17:02:15 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-07-22 17:02:15 +0200 |
commit | 3aa204c4268a5e44d7b839956f23167bfa9eb58f (patch) | |
tree | 5d5c101706f60ff3cb0ada465e3265baa5de5b62 /src/Hooks | |
parent | f77e7cc4c81438840dbaa36f771a3a353ff64739 (diff) | |
download | abrt-3aa204c4268a5e44d7b839956f23167bfa9eb58f.tar.gz abrt-3aa204c4268a5e44d7b839956f23167bfa9eb58f.tar.xz abrt-3aa204c4268a5e44d7b839956f23167bfa9eb58f.zip |
abrt-hook-ccpp: small fixes prompted by testing on RHEL5
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'src/Hooks')
-rw-r--r-- | src/Hooks/abrt-hook-ccpp.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/Hooks/abrt-hook-ccpp.cpp b/src/Hooks/abrt-hook-ccpp.cpp index 6e59df2a..e53007a4 100644 --- a/src/Hooks/abrt-hook-ccpp.cpp +++ b/src/Hooks/abrt-hook-ccpp.cpp @@ -251,6 +251,7 @@ static int open_user_core(const char *user_pwd, uid_t uid, pid_t pid) int main(int argc, char** argv) { + int i; struct stat sb; if (argc < 5) @@ -258,6 +259,17 @@ int main(int argc, char** argv) error_msg_and_die("Usage: %s: DUMPDIR PID SIGNO UID CORE_SIZE_LIMIT", argv[0]); } + /* Not needed on 2.6.30. + * At least 2.6.18 has a bug where + * argv[1] = "DUMPDIR PID SIGNO UID CORE_SIZE_LIMIT" + * argv[2] = "PID SIGNO UID CORE_SIZE_LIMIT" + * and so on. Fixing it: + */ + for (i = 1; argv[i]; i++) + { + strchrnul(argv[i], ' ')[0] = '\0'; + } + openlog("abrt", LOG_PID, LOG_DAEMON); logmode = LOGMODE_SYSLOG; @@ -282,7 +294,7 @@ int main(int argc, char** argv) char* executable = get_executable(pid, &src_fd_binary); if (executable == NULL) { - error_msg_and_die("can't read /proc/%lu/exe link", (long)pid); + perror_msg_and_die("can't read /proc/%lu/exe link", (long)pid); } if (strstr(executable, "/abrt-hook-ccpp")) { |