Fixed bug 223
authorIngo Huerner <ingo.huerner@xse.de>
Thu, 5 Jun 2014 13:35:02 +0000 (15:35 +0200)
committerIngo Huerner <ingo.huerner@xse.de>
Thu, 5 Jun 2014 13:35:02 +0000 (15:35 +0200)
src/persistence_client_library_backup_filelist.h
src/persistence_client_library_file.c

index 4c105b7..ac668f0 100644 (file)
@@ -87,7 +87,7 @@ int pclCalcCrc32Csum(int fd, char crc32sum[]);
  * @param csumPath the path to the checksum file
  * @param openFlag the file open flags
  *
- * @return
+ * @return -1 if the file could not be recovered or a positive value (>=0) on successful recovery
  */
 int pclVerifyConsistency(const char* origPath, const char* backupPath, const char* csumPath, int openFlags);
 
index d24257f..82e151c 100644 (file)
@@ -494,7 +494,8 @@ int pclFileCreatePath(unsigned int ldbid, const char* resource_id, unsigned int
                }
                // we don't need the file handle here
                // the application calling this function must use the POSIX open() function to get an file descriptor
-               close(handle);
+               if(handle > 0)
+                       close(handle);
             }
 
             handle = get_persistence_handle_idx();