Fix: use off_t type for lseek function return value to avoid overflow
[lttng-tools.git] / src / bin / lttng-sessiond / cmd.c
index 534f191a8b447d0763d56ec62d4aba42a0c3af70..ad635a9a96b631880171e012aeb462311424bade 100644 (file)
@@ -3671,10 +3671,12 @@ static
 int clear_metadata_file(int fd)
 {
        int ret;
+       off_t lseek_ret;
 
-       ret = lseek(fd, 0, SEEK_SET);
-       if (ret < 0) {
+       lseek_ret = lseek(fd, 0, SEEK_SET);
+       if (lseek_ret < 0) {
                PERROR("lseek");
+               ret = -1;
                goto end;
        }
 
This page took 0.023619 seconds and 4 git commands to generate.