aboutsummaryrefslogtreecommitdiffstats
path: root/executor/common_linux.h
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2022-11-23 15:40:11 +0100
committerDmitry Vyukov <dvyukov@google.com>2022-11-23 16:43:13 +0100
commit928544a6c60ea87fafae67c861747ee5b41868b3 (patch)
tree02ebc53344fdf1fa011280d81a9fe68477896f30 /executor/common_linux.h
parent351d395f89a03f58ec8cdf953847ab1458cdc7e5 (diff)
executor: don't reset loop device on partition scan success
We symlink resulting partitions into the test dir. If we do LOOP_CLR_FD, device and partitions disappear. Don't do LOOP_CLR_FD on success.
Diffstat (limited to 'executor/common_linux.h')
-rw-r--r--executor/common_linux.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/executor/common_linux.h b/executor/common_linux.h
index 8ca854c9e..c8dccc670 100644
--- a/executor/common_linux.h
+++ b/executor/common_linux.h
@@ -2982,7 +2982,8 @@ static long syz_read_part_table(volatile unsigned long size, volatile long image
}
}
error_clear_loop:
- ioctl(loopfd, LOOP_CLR_FD, 0);
+ if (res)
+ ioctl(loopfd, LOOP_CLR_FD, 0);
close(loopfd);
close(memfd);
errno = err;