Fix: use off_t type for lseek function return value to avoid overflow
[lttng-tools.git] / src / bin / lttng-sessiond / cmd.c
index 9d742536852b4880f30d7245f71d32567a94bc5e..081648889cebdc8e645e76c6b176d60a7a8d2faf 100644 (file)
@@ -3420,10 +3420,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.024452 seconds and 5 git commands to generate.