summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSooChan Lim <sc1.lim@samsung.com>2019-04-01 15:32:09 +0900
committerSooChan Lim <sc1.lim@samsung.com>2019-04-01 15:32:09 +0900
commit20427adbfb671a89e9bca8861df118326e7cd066 (patch)
tree40a46885719eb3d8bfa811617527d7a7a3c60945
parent0bcdc8f8aa4313415b6beb0ad23fce9c46cc2a24 (diff)
downloadlibtbm-shm-20427adbfb671a89e9bca8861df118326e7cd066.tar.gz
libtbm-shm-20427adbfb671a89e9bca8861df118326e7cd066.tar.bz2
libtbm-shm-20427adbfb671a89e9bca8861df118326e7cd066.zip
fix the error log
Change-Id: I2b70897e60f3cf02cd01adad708f0bfee72551fc
-rw-r--r--src/tbm_bufmgr_shm.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/tbm_bufmgr_shm.c b/src/tbm_bufmgr_shm.c
index 8aa8835..72c1615 100644
--- a/src/tbm_bufmgr_shm.c
+++ b/src/tbm_bufmgr_shm.c
@@ -651,9 +651,10 @@ tbm_shm_bufmgr_import_fd(tbm_backend_bufmgr_data *bufmgr_data, tbm_fd key, tbm_e
{
tbm_bo_shm bo_shm;
int real_size;
+ char buf[STRERR_BUFSIZE];
if (key < 0) {
- TBM_SHM_LOG("[libtbm-shm:%d] error %s:%d Invalid fd(%d)\n", getpid(), __FUNCTION__, __LINE__, key);
+ TBM_ERR("Invalid fd(%d)\n", key);
if (error)
*error = TBM_ERROR_INVALID_PARAMETER;
return 0;
@@ -661,7 +662,7 @@ tbm_shm_bufmgr_import_fd(tbm_backend_bufmgr_data *bufmgr_data, tbm_fd key, tbm_e
bo_shm = calloc(1, sizeof(struct _tbm_bo_shm));
if (!bo_shm) {
- TBM_SHM_LOG("[libtbm-shm:%d] error %s:%d Fail to allocate the bo private\n", getpid(), __FUNCTION__, __LINE__);
+ TBM_ERR("Fail to allocate the bo private\n");
if (error)
*error = TBM_ERROR_INVALID_OPERATION;
return 0;
@@ -669,7 +670,8 @@ tbm_shm_bufmgr_import_fd(tbm_backend_bufmgr_data *bufmgr_data, tbm_fd key, tbm_e
real_size = lseek(key, 0, SEEK_END);
if (real_size < 0) {
- TBM_SHM_LOG("[libtbm-shm:%d] error %s:%d Fail to allocate the bo private\n", getpid(), __FUNCTION__, __LINE__);
+ TBM_ERR("Fail to lseek(err:%s)\n",
+ strerror_r(errno, buf, STRERR_BUFSIZE));
free(bo_shm);
if (error)
*error = TBM_ERROR_INVALID_OPERATION;
@@ -679,8 +681,8 @@ tbm_shm_bufmgr_import_fd(tbm_backend_bufmgr_data *bufmgr_data, tbm_fd key, tbm_e
bo_shm->pBase = mmap(NULL, real_size,
PROT_READ | PROT_WRITE, MAP_SHARED, key, 0);
if (bo_shm->pBase == MAP_FAILED) {
- TBM_SHM_LOG("[libtbm-shm:%d] error %s:%d Fail to mmap (fd: %d, size:%d)\n", getpid(), __FUNCTION__, __LINE__,
- bo_shm->fd, real_size);
+ TBM_ERR("Fail to mmap (size:%d, err:%s)\n",
+ real_size, strerror_r(errno, buf, STRERR_BUFSIZE));
free(bo_shm);
if (error)
*error = TBM_ERROR_INVALID_OPERATION;