projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: use off_t type for lseek function return value to avoid overflow
[lttng-tools.git]
/
src
/
bin
/
lttng-relayd
/
main.c
diff --git
a/src/bin/lttng-relayd/main.c
b/src/bin/lttng-relayd/main.c
index e3c070f8ba0330c2c297983456b385be19ad0513..a8164ff2246fd3d1a409f9b7e4aaf891e805a82d 100644
(file)
--- a/
src/bin/lttng-relayd/main.c
+++ b/
src/bin/lttng-relayd/main.c
@@
-1588,6
+1588,7
@@
static
int rotate_truncate_stream(struct relay_stream *stream)
{
int ret, new_fd;
int rotate_truncate_stream(struct relay_stream *stream)
{
int ret, new_fd;
+ off_t lseek_ret;
uint64_t diff, pos = 0;
char buf[FILE_COPY_BUFFER_SIZE];
uint64_t diff, pos = 0;
char buf[FILE_COPY_BUFFER_SIZE];
@@
-1614,10
+1615,11
@@
int rotate_truncate_stream(struct relay_stream *stream)
* Rewind the current tracefile to the position at which the rotation
* should have occured.
*/
* Rewind the current tracefile to the position at which the rotation
* should have occured.
*/
- ret = lseek(stream->stream_fd->fd,
+
lseek_
ret = lseek(stream->stream_fd->fd,
stream->pos_after_last_complete_data_index, SEEK_SET);
stream->pos_after_last_complete_data_index, SEEK_SET);
- if (ret < 0) {
+ if (
lseek_
ret < 0) {
PERROR("seek truncate stream");
PERROR("seek truncate stream");
+ ret = -1;
goto end;
}
goto end;
}
This page took
0.026189 seconds
and
4
git commands to generate.