diff options
author | Ingo Huerner <ingo.huerner@xse.de> | 2015-01-23 16:38:09 +0100 |
---|---|---|
committer | Ingo Huerner <ingo.huerner@xse.de> | 2015-01-23 16:38:09 +0100 |
commit | 66e2d647c5df4fda121f460f6b086a7bc57cbec4 (patch) | |
tree | 148cb7364e5080c9fcf574607bc2777c0bf7551d | |
parent | 16239ca64c53eab04050a8a0672ef2520dad5773 (diff) | |
download | persistence-client-library-66e2d647c5df4fda121f460f6b086a7bc57cbec4.tar.gz |
Changed DLT log level
-rw-r--r-- | src/persistence_client_library.c | 1 | ||||
-rw-r--r-- | src/persistence_client_library_backup_filelist.c | 14 | ||||
-rw-r--r-- | src/persistence_client_library_file.c | 22 |
3 files changed, 23 insertions, 14 deletions
diff --git a/src/persistence_client_library.c b/src/persistence_client_library.c index edbeeae..c7d59b0 100644 --- a/src/persistence_client_library.c +++ b/src/persistence_client_library.c @@ -126,6 +126,7 @@ int pclInitLibrary(const char* appName, int shutdownMode) if(gPclInitCounter == 0) { DLT_REGISTER_CONTEXT(gPclDLTContext,"PCL","Context for persistence client library logging"); + DLT_SET_APPLICATION_LL_TS_LIMIT(DLT_LOG_DEBUG, DLT_TRACE_STATUS_OFF); DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclInitLibrary => INIT PCL - "), DLT_STRING(appName), DLT_STRING("- init counter: "), DLT_INT(gPclInitCounter) ); diff --git a/src/persistence_client_library_backup_filelist.c b/src/persistence_client_library_backup_filelist.c index 03f6fec..353033e 100644 --- a/src/persistence_client_library_backup_filelist.c +++ b/src/persistence_client_library_backup_filelist.c @@ -499,10 +499,9 @@ int pclCreateBackup(const char* dstPath, int srcfd, const char* csumPath, const dstFd = open(dstPath, O_CREAT | O_WRONLY | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH); if(dstFd != -1) { - off_t curPos = 0; - - curPos = lseek(srcfd, 0, SEEK_CUR); // remember the current position - lseek(srcfd, 0, SEEK_SET); // set to beginning of file + off_t curPos = lseek(srcfd, 0, SEEK_CUR); // remember the current position + if(curPos != 0) + lseek(srcfd, 0, SEEK_SET); // set to beginning of file // copy data from one file to another if((readSize = pclBackupDoFileCopy(srcfd, dstFd)) == -1) @@ -543,13 +542,10 @@ int pclCalcCrc32Csum(int fd, char crc32sum[]) if(buf != 0) { - off_t curPos = 0; - curPos = lseek(fd, 0, SEEK_CUR); // remember the current position + off_t curPos = lseek(fd, 0, SEEK_CUR); // remember the current position if(curPos != 0) - { - lseek(fd, 0, SEEK_SET); // set to beginning of the file - } + lseek(fd, 0, SEEK_SET); // set to beginning of the file while((rval = read(fd, buf, statBuf.st_size)) > 0) { diff --git a/src/persistence_client_library_file.c b/src/persistence_client_library_file.c index 70a1d7f..5765e09 100644 --- a/src/persistence_client_library_file.c +++ b/src/persistence_client_library_file.c @@ -87,10 +87,16 @@ int pclFileClose(int fd) if(permission != PersistencePermission_ReadOnly || permission != PersistencePermission_LastEntry) { // remove backup file - remove(get_file_backup_path(fd)); // we don't care about return value + if(remove(get_file_backup_path(fd)) == -1) + { + DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("pclFileClose - backup remove failed!"), DLT_STRING(strerror(errno))); + } // remove checksum file - remove(get_file_checksum_path(fd)); // we don't care about return value + if(remove(get_file_checksum_path(fd)) == -1) + { + DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("pclFileClose - csum remove failed!"), DLT_STRING(strerror(errno)) ); + } } __sync_fetch_and_sub(&gOpenFdArray[fd], FileClosed); // set closed flag @@ -471,7 +477,7 @@ int pclFileRemove(unsigned int ldbid, const char* resource_id, unsigned int user rval = remove(dbPath); if(rval == -1) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("fileRemove - remove()"), DLT_STRING(strerror(errno)) ); + DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("fileRemove - remove()"), DLT_STRING(resource_id), DLT_STRING(strerror(errno)) ); } } else @@ -777,10 +783,16 @@ int pclFileReleasePath(int pathHandle) if(permission != PersistencePermission_ReadOnly) { // remove backup file - remove(get_ossfile_backup_path(pathHandle)); // we don't care about return value + if(remove(get_ossfile_backup_path(pathHandle)) == -1) + { + DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("pclFileClose - backup remove failed!")); + } // remove checksum file - remove(get_ossfile_checksum_path(pathHandle)); // we don't care about return value + if(remove(get_ossfile_checksum_path(pathHandle)) == -1) + { + DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("pclFileClose - backup remove failed!"), DLT_STRING(strerror(errno)) ); + } } free(get_ossfile_file_path(pathHandle)); |