off_t offset)
{
enum ctf_msg_iter_status status = CTF_MSG_ITER_STATUS_OK;
- bt_self_component *self_comp = msg_it->self_comp;
enum ctf_msg_iter_medium_status medium_status;
BT_ASSERT(msg_it);
- if (offset < 0) {
- BT_COMP_LOGE_APPEND_CAUSE(self_comp,
- "Cannot seek to negative offset: offset=%jd",
- (intmax_t) offset);
- status = CTF_MSG_ITER_STATUS_INVAL;
- goto end;
- }
+ BT_ASSERT(offset >= 0);
if (!msg_it->medium.medops.seek) {
status = CTF_MSG_ITER_STATUS_UNSUPPORTED;
/** Unsupported operation. */
CTF_MSG_ITER_MEDIUM_STATUS_UNSUPPORTED = -3,
- /** Invalid argument. */
- CTF_MSG_ITER_MEDIUM_STATUS_INVAL = -2,
-
/** General error. */
CTF_MSG_ITER_MEDIUM_STATUS_ERROR = -1,
*/
CTF_MSG_ITER_STATUS_AGAIN = CTF_MSG_ITER_MEDIUM_STATUS_AGAIN,
- /** Invalid argument. */
- CTF_MSG_ITER_STATUS_INVAL = CTF_MSG_ITER_MEDIUM_STATUS_INVAL,
-
/** Unsupported operation. */
CTF_MSG_ITER_STATUS_UNSUPPORTED = CTF_MSG_ITER_MEDIUM_STATUS_UNSUPPORTED,
return "EOF";
case CTF_MSG_ITER_MEDIUM_STATUS_AGAIN:
return "AGAIN";
- case CTF_MSG_ITER_MEDIUM_STATUS_INVAL:
- return "INVAL";
case CTF_MSG_ITER_MEDIUM_STATUS_ERROR:
return "ERROR";
case CTF_MSG_ITER_MEDIUM_STATUS_OK:
return "EOF";
case CTF_MSG_ITER_STATUS_AGAIN:
return "AGAIN";
- case CTF_MSG_ITER_STATUS_INVAL:
- return "INVAL";
case CTF_MSG_ITER_STATUS_ERROR:
return "ERROR";
case CTF_MSG_ITER_STATUS_OK:
bt_self_component *self_comp = ds_file->self_comp;
bt_logging_level log_level = ds_file->log_level;
- if (offset < 0 || offset > file_size) {
- BT_COMP_LOGE("Invalid medium seek request: offset=%jd, file-size=%jd",
- (intmax_t) offset, (intmax_t) file_size);
- status = CTF_MSG_ITER_MEDIUM_STATUS_INVAL;
- goto end;
- }
+ BT_ASSERT(offset >= 0);
+ BT_ASSERT(offset < file_size);
/* If there is no current mapping, map the right file directly. */
if (!ds_file->mmap_addr) {
*/
ret = LTTNG_LIVE_ITERATOR_STATUS_CONTINUE;
break;
- case CTF_MSG_ITER_STATUS_INVAL:
- /* No argument provided by the user, so don't return INVAL. */
case CTF_MSG_ITER_STATUS_ERROR:
default:
ret = LTTNG_LIVE_ITERATOR_STATUS_ERROR;