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
/
common
/
utils.c
diff --git
a/src/common/utils.c
b/src/common/utils.c
index aa11551c30635fd4e423382092fd1871a2534b17..24c3b8ca146ff1fafe8de8da3dd059c7f947f415 100644
(file)
--- a/
src/common/utils.c
+++ b/
src/common/utils.c
@@
-1335,15
+1335,17
@@
LTTNG_HIDDEN
int utils_truncate_stream_file(int fd, off_t length)
{
int ret;
int utils_truncate_stream_file(int fd, off_t length)
{
int ret;
+ off_t lseek_ret;
ret = ftruncate(fd, length);
if (ret < 0) {
PERROR("ftruncate");
goto end;
}
ret = ftruncate(fd, length);
if (ret < 0) {
PERROR("ftruncate");
goto end;
}
- ret = lseek(fd, length, SEEK_SET);
- if (ret < 0) {
+
lseek_
ret = lseek(fd, length, SEEK_SET);
+ if (
lseek_
ret < 0) {
PERROR("lseek");
PERROR("lseek");
+ ret = -1;
goto end;
}
end:
goto end;
}
end:
This page took
0.025202 seconds
and
4
git commands to generate.