#define LOG_TAG "DATA_CONTROL"
#endif
+#define ERR_BUFFER_SIZE 1024
#define MAX_ROW_COUNT 1024
resultset_cursor *datacontrol_sql_get_cursor()
int ret = 0;
int column_len = 0;
int fd = cursor->resultset_fd;
+ char err_buf[ERR_BUFFER_SIZE];
ret = lseek(fd, cursor->resultset_col_name_offset, SEEK_SET);
if (ret < 0) {
LOGE("unable to seek in the resultset file: %d %s", cursor->resultset_current_offset,
- strerror(errno));
+ strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
col_name = (char *)calloc(column_len, sizeof(char));
ret = read(fd, col_name, column_len);
if (ret == 0) {
- LOGE("unable to read col_name : %s", strerror(errno));
+ LOGE("unable to read col_name : %s", strerror_r(errno, err_buf, sizeof(err_buf)));
free(col_name);
return DATACONTROL_ERROR_IO_ERROR;
}
} else {
ret = lseek(fd, column_len, SEEK_CUR);
if (ret < 0) {
- LOGE("unable to seek in the resultset file: %s", strerror(errno));
+ LOGE("unable to seek in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
}
int size = 0;
int i = 0;
int ret = 0;
-
+ char err_buf[ERR_BUFFER_SIZE];
int fd = cursor->resultset_fd;
ret = lseek(fd, cursor->resultset_current_offset, SEEK_SET);
if (ret < 0) {
LOGE("unable to seek in the resultset file: %d %s", cursor->resultset_current_offset,
- strerror(errno));
+ strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
for (i = 0; i < column_index; i++) {
ret = read(fd, &type, sizeof(int));
if (ret == 0) {
- LOGE("unable to read in the resultset file: %s", strerror(errno));
+ LOGE("unable to read in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
ret = read(fd, &size, sizeof(int));
if (ret == 0) {
- LOGE("unable to read in the resultset file: %s", strerror(errno));
+ LOGE("unable to read in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
ret = lseek(fd, size, SEEK_CUR);
if (ret < 0) {
- LOGE("unable to seek in the resultset file: %s", strerror(errno));
+ LOGE("unable to seek in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
}
ret = read(fd, &type, sizeof(int));
if (ret == 0) {
- LOGE("unable to read in the resultset file: %s", strerror(errno));
+ LOGE("unable to read in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
ret = read(fd, &size, sizeof(int));
if (ret == 0) {
- LOGE("unable to read in the resultset file: %s", strerror(errno));
+ LOGE("unable to read in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
int i = 0;
int size = 0;
int ret = 0;
-
+ char err_buf[ERR_BUFFER_SIZE];
int fd = cursor->resultset_fd;
ret = lseek(fd, cursor->resultset_current_offset, SEEK_SET);
if (ret < 0) {
- LOGE("unable to seek in the resultset file: %s", strerror(errno));
+ LOGE("unable to seek in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
for (i = 0; i < column_index; i++) {
ret = read(fd, &type, sizeof(int));
if (ret == 0) {
- LOGE("unable to read in the resultset file: %s", strerror(errno));
+ LOGE("unable to read in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
ret = read(fd, &size, sizeof(int));
if (ret == 0) {
- LOGE("unable to read in the resultset file: %s", strerror(errno));
+ LOGE("unable to read in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
ret = lseek(fd, size, SEEK_CUR);
if (ret < 0) {
- LOGE("unable to seek in the resultset file: %s", strerror(errno));
+ LOGE("unable to seek in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
}
ret = read(fd, &type, sizeof(int));
if (ret == 0) {
- LOGE("unable to read in the resultset file: %s", strerror(errno));
+ LOGE("unable to read in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
int size = 0;
int i = 0;
int ret = 0;
-
+ char err_buf[ERR_BUFFER_SIZE];
int fd = cursor->resultset_fd;
ret = lseek(fd, cursor->resultset_current_offset, SEEK_SET);
if (ret < 0) {
- LOGE("unable to seek in the resultset file: %s", strerror(errno));
+ LOGE("unable to seek in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
for (i = 0; i < column_index; i++) {
ret = read(fd, &type, sizeof(int));
if (ret == 0) {
- LOGE("unable to read in the resultset file: %s", strerror(errno));
+ LOGE("unable to read in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
ret = read(fd, &size, sizeof(int));
if (ret == 0) {
- LOGE("unable to read in the resultset file: %s", strerror(errno));
+ LOGE("unable to read in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
ret = lseek(fd, size, SEEK_CUR);
if (ret < 0) {
- LOGE("unable to seek in the resultset file: %s", strerror(errno));
+ LOGE("unable to seek in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
}
ret = read(fd, &type, sizeof(int));
if (ret == 0) {
- LOGE("unable to read in the resultset file: %s", strerror(errno));
+ LOGE("unable to read in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
ret = read(fd, &size, sizeof(int));
if (ret == 0) {
- LOGE("unable to read size in the resultset file: %s", strerror(errno));
+ LOGE("unable to read size in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
ret = read(fd, data, size);
if (ret < size) {
- LOGE("unable to read in the resultset file: %s", strerror(errno));
+ LOGE("unable to read in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
free(data);
return DATACONTROL_ERROR_IO_ERROR;
}
int size = 0;
int i = 0;
int ret = 0;
-
+ char err_buf[ERR_BUFFER_SIZE];
int fd = cursor->resultset_fd;
ret = lseek(fd, cursor->resultset_current_offset, SEEK_SET);
if (ret < 0) {
- LOGE("unable to seek in the resultset file: %s", strerror(errno));
+ LOGE("unable to seek in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
for (i = 0; i < column_index; i++) {
ret = read(fd, &type, sizeof(int));
if (ret == 0) {
- LOGE("unable to read in the resultset file: %s", strerror(errno));
+ LOGE("unable to read in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
ret = read(fd, &size, sizeof(int));
if (ret == 0) {
- LOGE("unable to read in the resultset file: %s", strerror(errno));
+ LOGE("unable to read in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
ret = lseek(fd, size, SEEK_CUR);
if (ret < 0) {
- LOGE("unable to seek in the resultset file: %s", strerror(errno));
+ LOGE("unable to seek in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
}
ret = read(fd, &type, sizeof(int));
if (ret == 0) {
- LOGE("unable to read in the resultset file: %s", strerror(errno));
+ LOGE("unable to read in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
ret = read(fd, &size, sizeof(int));
if (ret == 0) {
- LOGE("unable to read in the resultset file: %s", strerror(errno));
+ LOGE("unable to read in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
ret = read(fd, data, size);
if (ret < size) {
- LOGE("unable to read in the resultset file: %s", strerror(errno));
+ LOGE("unable to read in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
int size = 0;
int i = 0;
int ret = 0;
-
+ char err_buf[ERR_BUFFER_SIZE];
int fd = cursor->resultset_fd;
ret = lseek(fd, cursor->resultset_current_offset, SEEK_SET);
if (ret < 0) {
- LOGE("unable to seek in the resultset file: %s", strerror(errno));
+ LOGE("unable to seek in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
for (i = 0; i < column_index; i++) {
ret = read(fd, &type, sizeof(int));
if (ret == 0) {
- LOGE("unable to read in the resultset file: %s", strerror(errno));
+ LOGE("unable to read in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
ret = read(fd, &size, sizeof(int));
if (ret == 0) {
- LOGE("unable to read in the resultset file: %s", strerror(errno));
+ LOGE("unable to read in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
ret = lseek(fd, size, SEEK_CUR);
if (ret < 0) {
- LOGE("unable to seek in the resultset file: %s", strerror(errno));
+ LOGE("unable to seek in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
}
ret = read(fd, &type, sizeof(int));
if (ret == 0) {
- LOGE("unable to read in the resultset file: %s", strerror(errno));
+ LOGE("unable to read in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
ret = read(fd, &size, sizeof(int));
if (ret == 0) {
- LOGE("unable to read in the resultset file: %s", strerror(errno));
+ LOGE("unable to read in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
ret = read(fd, data, size);
if (ret < size) {
- LOGE("unable to read in the resultset file: %s", strerror(errno));
+ LOGE("unable to read in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
int size = 0;
int i = 0;
int ret = 0;
-
+ char err_buf[ERR_BUFFER_SIZE];
int fd = cursor->resultset_fd;
ret = lseek(fd, cursor->resultset_current_offset, SEEK_SET);
if (ret < 0) {
- LOGE("unable to seek in the resultset file: %s", strerror(errno));
+ LOGE("unable to seek in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
for (i = 0; i < column_index; i++) {
ret = read(fd, &type, sizeof(int));
if (ret == 0) {
- LOGE("unable to read in the resultset file: %s", strerror(errno));
+ LOGE("unable to read in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
ret = read(fd, &size, sizeof(int));
if (ret == 0) {
- LOGE("unable to read in the resultset file: %s", strerror(errno));
+ LOGE("unable to read in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
ret = lseek(fd, size, SEEK_CUR);
if (ret < 0) {
- LOGE("unable to seek in the resultset file: %s", strerror(errno));
+ LOGE("unable to seek in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
}
ret = read(fd, &type, sizeof(int));
if (ret == 0) {
- LOGE("unable to read in the resultset file: %s", strerror(errno));
+ LOGE("unable to read in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
ret = read(fd, &size, sizeof(int));
if (ret == 0) {
- LOGE("unable to read in the resultset file: %s", strerror(errno));
+ LOGE("unable to read in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
return DATACONTROL_ERROR_IO_ERROR;
}
memset(data, 0, size + 1);
ret = read(fd, data, size);
if (ret < size) {
- LOGE("unable to read in the resultset file: %s", strerror(errno));
+ LOGE("unable to read in the resultset file: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
free(data);
return DATACONTROL_ERROR_IO_ERROR;
}