@@ -75,7 +75,7 @@ FSError FSWrapper::FSReadDirWrapper(const FSDirectoryHandle handle, FSDirectoryE
7575 DIR *dir = dirHandle->dir ;
7676
7777 FSError result = FS_ERROR_END_OF_DIR ;
78- DEBUG_FUNCTION_LINE_VERBOSE (" [%s] readdir %08X (handle %08X)" , getName ().c_str (), dir, handle);
78+ DEBUG_FUNCTION_LINE_VERBOSE (" [%s] readdir %p (handle %08X)" , getName ().c_str (), dir, handle);
7979 do {
8080 errno = 0 ;
8181 struct dirent *entry_ = readdir (dir);
@@ -128,7 +128,7 @@ FSError FSWrapper::FSReadDirWrapper(const FSDirectoryHandle handle, FSDirectoryE
128128 } else {
129129 auto err = errno;
130130 if (err != 0 ) {
131- DEBUG_FUNCTION_LINE_ERR (" [%s] Failed to read dir %08X (handle %08X). errno %d (%s)" , getName ().c_str (), dir, handle, err, strerror (err));
131+ DEBUG_FUNCTION_LINE_ERR (" [%s] Failed to read dir %p (handle %08X). errno %d (%s)" , getName ().c_str (), dir, handle, err, strerror (err));
132132 result = FS_ERROR_MEDIA_ERROR ;
133133 }
134134 }
@@ -146,9 +146,9 @@ FSError FSWrapper::FSCloseDirWrapper(const FSDirectoryHandle handle) {
146146 DIR *dir = dirHandle->dir ;
147147
148148 FSError result = FS_ERROR_OK ;
149- DEBUG_FUNCTION_LINE_VERBOSE (" [%s] closedir %08X (handle %08X)" , getName ().c_str (), dir, handle);
149+ DEBUG_FUNCTION_LINE_VERBOSE (" [%s] closedir %p (handle %08X)" , getName ().c_str (), dir, handle);
150150 if (closedir (dir) < 0 ) {
151- DEBUG_FUNCTION_LINE_ERR (" [%s] Failed to close dir %08X (handle %08X)" , getName ().c_str (), dir, handle);
151+ DEBUG_FUNCTION_LINE_ERR (" [%s] Failed to close dir %p (handle %08X)" , getName ().c_str (), dir, handle);
152152 result = FS_ERROR_MEDIA_ERROR ;
153153 }
154154 dirHandle->dir = nullptr ;
@@ -164,7 +164,7 @@ FSError FSWrapper::FSRewindDirWrapper(const FSDirectoryHandle handle) {
164164
165165 DIR *dir = dirHandle->dir ;
166166
167- DEBUG_FUNCTION_LINE_VERBOSE (" [%s] rewinddir %08X (handle %08X)" , getName ().c_str (), dir, handle);
167+ DEBUG_FUNCTION_LINE_VERBOSE (" [%s] rewinddir %p (handle %08X)" , getName ().c_str (), dir, handle);
168168 rewinddir (dir);
169169
170170 return FS_ERROR_OK ;
@@ -397,7 +397,7 @@ FSError FSWrapper::FSReadFileWrapper(void *buffer, const uint32_t size, const ui
397397 auto fileHandle = getFileFromHandle (handle);
398398 int real_fd = fileHandle->fd ;
399399
400- DEBUG_FUNCTION_LINE_VERBOSE (" [%s] Read %u bytes of fd %08X (FSFileHandle %08X) to buffer %08X " , getName ().c_str (), size * count, real_fd, handle, buffer);
400+ DEBUG_FUNCTION_LINE_VERBOSE (" [%s] Read %u bytes of fd %08X (FSFileHandle %08X) to buffer %p " , getName ().c_str (), size * count, real_fd, handle, buffer);
401401 int64_t read = readIntoBuffer (real_fd, buffer, size, count);
402402
403403 FSError result;
@@ -468,7 +468,7 @@ FSError FSWrapper::FSGetPosFileWrapper(const FSFileHandle handle, uint32_t *pos)
468468 DEBUG_FUNCTION_LINE_VERBOSE (" [%s] lseek fd %08X (FSFileHandle %08X) to get current position for truncation" , getName ().c_str (), real_fd, handle);
469469 off_t currentPos = lseek (real_fd, (off_t ) 0 , SEEK_CUR );
470470 if (currentPos == -1 ) {
471- DEBUG_FUNCTION_LINE_ERR (" [%s] Failed to get current position (res: %lld) of fd (handle %08X) to check EoF" , getName ().c_str (), currentPos, real_fd, handle);
471+ DEBUG_FUNCTION_LINE_ERR (" [%s] Failed to get current position (res: %lld) of fd %08X (handle %08X) to check EoF" , getName ().c_str (), currentPos, real_fd, handle);
472472 result = FS_ERROR_MEDIA_ERROR ;
473473 } else {
474474 *pos = currentPos;
@@ -493,7 +493,7 @@ FSError FSWrapper::FSIsEofWrapper(const FSFileHandle handle) {
493493
494494 if (currentPos == -1 || endPos == -1 ) {
495495 // TODO: check errno
496- DEBUG_FUNCTION_LINE_ERR (" [%s] Failed to get current position (res: %lld) or endPos (res: %lld) of fd (handle %08X) to check EoF" , getName ().c_str (), currentPos, endPos, real_fd, handle);
496+ DEBUG_FUNCTION_LINE_ERR (" [%s] Failed to get current position (res: %lld) or endPos (res: %lld) of fd %08X (handle %08X) to check EoF" , getName ().c_str (), currentPos, endPos, real_fd, handle);
497497 result = FS_ERROR_MEDIA_ERROR ;
498498 } else if (currentPos == endPos) {
499499 DEBUG_FUNCTION_LINE_VERBOSE (" [%s] FSIsEof END for %d\n " , getName ().c_str (), real_fd);
@@ -512,7 +512,7 @@ FSError FSWrapper::FSTruncateFileWrapper(const FSFileHandle handle) {
512512 return FS_ERROR_FORCE_PARENT_LAYER ;
513513 }
514514
515- if (! pIsWriteable) {
515+ if (pIsWriteable) {
516516 DEBUG_FUNCTION_LINE_VERBOSE (" [%s] Tried to truncate fd %d (handle %08X) but layer is not writeable" , getName ().c_str (), getFileFromHandle (handle)->fd , handle);
517517 return FS_ERROR_ACCESS_ERROR ;
518518 }
@@ -527,7 +527,7 @@ FSError FSWrapper::FSTruncateFileWrapper(const FSFileHandle handle) {
527527 off_t currentPos = lseek (real_fd, (off_t ) 0 , SEEK_CUR );
528528 if (currentPos == -1 ) {
529529 // TODO check errno
530- DEBUG_FUNCTION_LINE_ERR (" [%s] Failed to get current position of fd (handle %08X) to truncate file" , getName ().c_str (), real_fd, handle);
530+ DEBUG_FUNCTION_LINE_ERR (" [%s] Failed to get current position of fd %08X (handle %08X) to truncate file" , getName ().c_str (), real_fd, handle);
531531 result = FS_ERROR_MEDIA_ERROR ;
532532 } else {
533533 DEBUG_FUNCTION_LINE_VERBOSE (" [%s] Truncate fd %08X (FSFileHandle %08X) to %lld bytes " , getName ().c_str (), real_fd, handle, currentPos);
@@ -554,11 +554,11 @@ FSError FSWrapper::FSWriteFileWrapper(const uint8_t *buffer, const uint32_t size
554554
555555 int real_fd = fileHandle->fd ;
556556
557- DEBUG_FUNCTION_LINE_VERBOSE (" [%s] Write %u bytes to fd %08X (FSFileHandle %08X) from buffer %08X " , getName ().c_str (), count * size, real_fd, handle, buffer);
557+ DEBUG_FUNCTION_LINE_VERBOSE (" [%s] Write %u bytes to fd %08X (FSFileHandle %08X) from buffer %p " , getName ().c_str (), count * size, real_fd, handle, buffer);
558558 auto writeRes = writeFromBuffer (real_fd, buffer, size, count);
559559 if (writeRes < 0 ) {
560560 auto err = errno;
561- DEBUG_FUNCTION_LINE_ERR (" [%s] Write failed %u bytes to fd %08X (FSFileHandle %08X) from buffer %08X errno %d" , getName ().c_str (), count * size, real_fd, handle, buffer, err);
561+ DEBUG_FUNCTION_LINE_ERR (" [%s] Write failed %u bytes to fd %08X (FSFileHandle %08X) from buffer %p errno %d" , getName ().c_str (), count * size, real_fd, handle, buffer, err);
562562 if (err == EFBIG ) {
563563 result = FS_ERROR_FILE_TOO_BIG ;
564564 } else if (err == EACCES ) {
@@ -640,7 +640,7 @@ FSError FSWrapper::FSFlushFileWrapper(const FSFileHandle handle) {
640640 const auto fileHandle = getFileFromHandle (handle);
641641 const int real_fd = fileHandle->fd ;
642642
643- DEBUG_FUNCTION_LINE_VERBOSE (" [%s] fsync fd %08X (FSFileHandle %08X)" , real_fd, handle);
643+ DEBUG_FUNCTION_LINE_VERBOSE (" [%s] fsync fd %08X (FSFileHandle %08X)" , getName (). c_str (), real_fd, handle);
644644 FSError result = FS_ERROR_OK ;
645645 if (fsync (real_fd) < 0 ) {
646646 DEBUG_FUNCTION_LINE_ERR (" [%s] fsync failed for fd %08X (FSFileHandle %08X)" , getName ().c_str (), real_fd, handle);
0 commit comments