summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--atasmart.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/atasmart.c b/atasmart.c
index 44e095d..c778831 100644
--- a/atasmart.c
+++ b/atasmart.c
@@ -1919,7 +1919,13 @@ int sk_disk_open(const char *name, SkDisk **_d) {
goto fail;
}
- if ((d->fd = open(name, O_RDONLY|O_NOCTTY)) < 0) {
+ if ((d->fd = open(name,
+ O_RDONLY|O_NOCTTY|O_NONBLOCK
+#ifdef O_CLOEXEC
+ |O_CLOEXEC
+#endif
+
+ )) < 0) {
ret = d->fd;
goto fail;
}