summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changes2
-rw-r--r--eio.c8
-rw-r--r--eio.h4
3 files changed, 10 insertions, 4 deletions
diff --git a/Changes b/Changes
index 55fe525..37aedc9 100644
--- a/Changes
+++ b/Changes
@@ -6,6 +6,8 @@ TODO: maybe add mincore support? available on at leats darwin, solaris, linux, f
- readdir: correctly handle malloc failures.
- readdir: new flags argument, can return inode
and possibly filetype, can sort in various ways.
+ - readdir: stop immediately when cancelled, do
+ not continue reading the directory.
- added EIO_STACKSIZE.
- added msync, mtouch support (untested).
- added sync_file_range (untested).
diff --git a/eio.c b/eio.c
index 41561d3..cef46a3 100644
--- a/eio.c
+++ b/eio.c
@@ -1213,9 +1213,13 @@ eio__scandir (eio_req *req, etp_worker *self)
namesoffs += len;
++dentoffs;
}
+
+ if (EIO_CANCELLED (req))
+ {
+ errno = ECANCELED;
+ break;
+ }
}
- else
- req->result = -1;
}
#if !(_POSIX_MAPPED_FILES && _POSIX_SYNCHRONIZED_IO)
diff --git a/eio.h b/eio.h
index 33a4fbb..0b8625f 100644
--- a/eio.h
+++ b/eio.h
@@ -78,7 +78,7 @@ enum eio_dtype {
EIO_DT_UNKNOWN = 0,
EIO_DT_FIFO = 1,
EIO_DT_CHR = 2,
- EIO_DT_MPC = 3, /* multiplexed char device (v7+Coherent) */
+ EIO_DT_MPC = 3, /* multiplexed char device (v7+coherent) */
EIO_DT_DIR = 4,
EIO_DT_NAM = 5, /* xenix special named file */
EIO_DT_BLK = 6,
@@ -91,7 +91,7 @@ enum eio_dtype {
EIO_DT_SOCK = 12,
EIO_DT_DOOR = 13, /* solaris door */
EIO_DT_WHT = 14,
- EIO_DT_MAX = 15 /* highest DT_VALUE ever, hopefully */
+ EIO_DT_MAX = 15 /* highest DT_VALUE ever, hopefully */
};
struct eio_dirent {