Add CONFIG_DEBUG_ERROR. Change names of *dbg() * *err()

This commit is contained in:
Gregory Nutt
2016-06-11 15:50:49 -06:00
parent e99301d7c2
commit a1469a3e95
1091 changed files with 5971 additions and 5966 deletions
+3 -3
View File
@@ -135,14 +135,14 @@ FAR void *mmap(FAR void *start, size_t length, int prot, int flags,
if (prot == PROT_NONE ||
(flags & (MAP_PRIVATE | MAP_FIXED | MAP_ANONYMOUS | MAP_DENYWRITE)) != 0)
{
fdbg("Unsupported options, prot=%x flags=%04x\n", prot, flags);
ferr("Unsupported options, prot=%x flags=%04x\n", prot, flags);
set_errno(ENOSYS);
return MAP_FAILED;
}
if (length == 0 || (flags & MAP_SHARED) == 0)
{
fdbg("Invalid options, lengt=%d flags=%04x\n", length, flags);
ferr("Invalid options, lengt=%d flags=%04x\n", length, flags);
set_errno(EINVAL);
return MAP_FAILED;
}
@@ -163,7 +163,7 @@ FAR void *mmap(FAR void *start, size_t length, int prot, int flags,
#ifdef CONFIG_FS_RAMMAP
return rammap(fd, length, offset);
#else
fdbg("ioctl(FIOC_MMAP) failed: %d\n", get_errno());
ferr("ioctl(FIOC_MMAP) failed: %d\n", get_errno());
return MAP_FAILED;
#endif
}
+2 -2
View File
@@ -143,7 +143,7 @@ int munmap(FAR void *start, size_t length)
if (!curr)
{
fdbg("Region not found\n");
ferr("Region not found\n");
errcode = EINVAL;
goto errout_with_semaphore;
}
@@ -158,7 +158,7 @@ int munmap(FAR void *start, size_t length)
offset = start - curr->addr;
if (offset + length < curr->length)
{
fdbg("Cannot umap without unmapping to the end\n");
ferr("Cannot umap without unmapping to the end\n");
errcode = ENOSYS;
goto errout_with_semaphore;
}
+4 -4
View File
@@ -142,7 +142,7 @@ FAR void *rammap(int fd, size_t length, off_t offset)
alloc = (FAR uint8_t *)kumm_malloc(sizeof(struct fs_rammap_s) + length);
if (!alloc)
{
fdbg("Region allocation failed, length: %d\n", (int)length);
ferr("Region allocation failed, length: %d\n", (int)length);
errcode = ENOMEM;
goto errout;
}
@@ -164,7 +164,7 @@ FAR void *rammap(int fd, size_t length, off_t offset)
* the correct response.
*/
fdbg("Seek to position %d failed\n", (int)offset);
ferr("Seek to position %d failed\n", (int)offset);
errcode = EINVAL;
goto errout_with_region;
}
@@ -186,11 +186,11 @@ FAR void *rammap(int fd, size_t length, off_t offset)
{
/* All other read errors are bad. errno is already set.
* (but maybe should be forced to EINVAL?). NOTE that if
* FS DEBUG is enabled, then the following fdbg() macro will
* FS DEBUG is enabled, then the following ferr() macro will
* destroy the errno value.
*/
fdbg("Read failed: offset=%d errno=%d\n", (int)offset, errcode);
ferr("Read failed: offset=%d errno=%d\n", (int)offset, errcode);
#ifdef CONFIG_DEBUG_FS
goto errout_with_region;
#else