# HG changeset patch # User Yasumasa Suenaga # Date 1570543976 -32400 # Node ID 5d5beb9883dfe63e1aba932dafeebf61107f44dc # Parent e75ae2bc501e05b73adcf9d68c3168764a8b8614 Bug 3759: HeapStats Agent could not be built on CentOS 6 Reviewed-by: ykubota https://github.com/HeapStats/heapstats/pull/149 diff -r e75ae2bc501e -r 5d5beb9883df ChangeLog --- a/ChangeLog Mon Oct 07 21:16:19 2019 +0900 +++ b/ChangeLog Tue Oct 08 23:12:56 2019 +0900 @@ -1,3 +1,7 @@ +2019-10-08 Yasumasa Suenaga + + * Bug 3759: HeapStats Agent could not be built on CentOS 6 + 2019-10-07 Yasumasa Suenaga * Bug 3757: Update SPEC for modularity diff -r e75ae2bc501e -r 5d5beb9883df agent/src/heapstats-engines/fsUtil.cpp --- a/agent/src/heapstats-engines/fsUtil.cpp Mon Oct 07 21:16:19 2019 +0900 +++ b/agent/src/heapstats-engines/fsUtil.cpp Tue Oct 08 23:12:56 2019 +0900 @@ -350,6 +350,8 @@ * \param isDirectory [in] Path is directory. * \return Unique path.
Don't forget deallocate. */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstringop-truncation" char *createUniquePath(char *path, bool isDirectory) { /* Variable for temporary path. */ char tempPath[PATH_MAX] = {0}; @@ -369,8 +371,6 @@ /* Search extension. */ char *extPos = strrchr(path, '.'); -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wstringop-truncation" /* If create path for file and exists extension. */ if (!isDirectory && extPos != NULL) { int pathSize = (extPos - path); @@ -386,7 +386,6 @@ /* Copy default path. */ strncpy(tempPath, path, PATH_MAX); -#pragma GCC diagnostic pop /* Try make unique path loop. */ const unsigned long int MAX_RETRY_COUNT = 1000000; @@ -460,6 +459,7 @@ return result; } +#pragma GCC diagnostic pop /*! * \brief Get parent directory path. diff -r e75ae2bc501e -r 5d5beb9883df agent/src/heapstats-engines/logManager.cpp --- a/agent/src/heapstats-engines/logManager.cpp Mon Oct 07 21:16:19 2019 +0900 +++ b/agent/src/heapstats-engines/logManager.cpp Tue Oct 08 23:12:56 2019 +0900 @@ -1428,6 +1428,8 @@ * Don't forget deallocate memory.
* Process is failure, if value is null. */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstringop-truncation" char *TLogManager::createArchiveName(TMSecTime nowTime) { time_t nowTimeSec = 0; struct tm time_struct = {0}; @@ -1436,8 +1438,6 @@ char extPart[PATH_MAX] = {0}; char namePart[PATH_MAX] = {0}; -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wstringop-truncation" /* Search extension. */ char *archiveFileName = conf->ArchiveFile()->get(); char *extPos = strrchr(archiveFileName, '.'); @@ -1449,7 +1449,6 @@ /* Not found extension in path. */ strncpy(namePart, archiveFileName, PATH_MAX); } -#pragma GCC diagnostic pop /* Get now datetime and convert to string. */ nowTimeSec = (time_t)(nowTime / 1000); @@ -1466,3 +1465,4 @@ /* Create unique file name. */ return createUniquePath(arcName, false); } +#pragma GCC diagnostic pop