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