diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-02-02 16:33:54 +0100 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-02-02 16:33:54 +0100 |
| commit | 158c7a997620ca60dfd66fd345a64eb13287e2b2 (patch) | |
| tree | 0f42f29c853f16d9e6d3e13a7d8dd21b936195b5 | |
| parent | 931fb702e814c3a01261d1c17765dba4cc309280 (diff) | |
| parent | e9107ed5c99a1628a733d597395d620d1f062023 (diff) | |
Merge branch 'master' into rhel6
| -rw-r--r-- | lib/Plugins/CCpp.cpp | 33 |
1 files changed, 7 insertions, 26 deletions
diff --git a/lib/Plugins/CCpp.cpp b/lib/Plugins/CCpp.cpp index 0adfc7c..c75b152 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; |
