summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-02-02 16:33:07 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-02-02 16:33:07 +0100
commite9107ed5c99a1628a733d597395d620d1f062023 (patch)
tree9bf65b6eb7b7694b9fcb28ba38f748cb36ae3cb1
parentbf53954d6aa9f1d107efe8649d174f8e92c4592e (diff)
downloadabrt-e9107ed5c99a1628a733d597395d620d1f062023.tar.gz
abrt-e9107ed5c99a1628a733d597395d620d1f062023.tar.xz
abrt-e9107ed5c99a1628a733d597395d620d1f062023.zip
CCpp plugin: add forgotten closedir()
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--lib/Plugins/CCpp.cpp33
1 files changed, 7 insertions, 26 deletions
diff --git a/lib/Plugins/CCpp.cpp b/lib/Plugins/CCpp.cpp
index 0adfc7c0..c75b1523 100644
--- a/lib/Plugins/CCpp.cpp
+++ b/lib/Plugins/CCpp.cpp
@@ -752,26 +752,6 @@ void CAnalyzerCCpp::CreateReport(const char *pDebugDumpDir, int force)
*/
#ifdef HOSTILE_KERNEL
#define CORE_SIZE_PATTERN "Max core file size=1:unlimited"
-static char *skip_whitespace(char *str)
-{
- while (*str) {
- if (*str != ' ' && *str != '\t')
- return str;
- str++;
- }
- return str;
-}
-
-static char *skip_non_whitespace(char *str)
-{
- while (*str) {
- if (*str == ' ' || *str == '\t')
- return str;
- str++;
- }
- return str;
-}
-
static int isdigit_str(char *str)
{
do {
@@ -785,7 +765,7 @@ static int set_limits()
{
DIR *dir = opendir("/proc");
if (!dir) {
- /* this shouldn't fail, but to be safe.. */
+ /* this shouldn't fail, but to be safe.. */
return 1;
}
@@ -814,7 +794,7 @@ static int set_limits()
}
fclose(limits_fp);
if (!ulimit_c || ulimit_c[0] != '0' || ulimit_c[1] != '\0') {
- /*process has nonzero ulimit -c, so need to modify it*/
+ /*process has nonzero ulimit -c, so need to modify it*/
return 0;
}
/* echo -n 'Max core file size=1:unlimited' >/proc/PID/limits */
@@ -823,15 +803,16 @@ static int set_limits()
errno = 0;
/*full_*/
ssize_t n = write(fd, CORE_SIZE_PATTERN, sizeof(CORE_SIZE_PATTERN)-1);
- if(n < sizeof(CORE_SIZE_PATTERN)-1)
- log("warning: can't write limit to: %s", limits_name);
+ if (n < sizeof(CORE_SIZE_PATTERN)-1)
+ log("warning: can't write limit to: %s", limits_name);
close(fd);
}
}
- return 0;
+ closedir(dir);
+ return 0;
}
-
#endif /* HOSTILE_KERNEL */
+
void CAnalyzerCCpp::Init()
{
ifstream fInCorePattern;