diff options
-rw-r--r-- | Changes | 2 | ||||
-rw-r--r-- | eio.c | 8 | ||||
-rw-r--r-- | eio.h | 4 |
3 files changed, 10 insertions, 4 deletions
@@ -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). @@ -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) @@ -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 { |