From 8a3e312f06c4dcb6f97dfa1bf654d401705f89bc Mon Sep 17 00:00:00 2001 From: Peter Lieven Date: Sun, 21 Oct 2012 08:24:24 +0200 Subject: [PATCH] LD_ISCSI: Fail open with O_NONBLOCK Non-Blocking I/O is supported nowhere in the code. We should fail until we have support for it. --- src/ld_iscsi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ld_iscsi.c b/src/ld_iscsi.c index cba17c6..0caf785 100644 --- a/src/ld_iscsi.c +++ b/src/ld_iscsi.c @@ -67,6 +67,12 @@ int open(const char *path, int flags, mode_t mode) struct scsi_task *task; struct scsi_readcapacity10 *rc10; + if (mode & O_NONBLOCK) { + LD_ISCSI_DPRINTF(0,"Non-blocking I/O is currently not supported"); + errno = EINVAL; + return -1; + } + iscsi = iscsi_create_context(initiator); if (iscsi == NULL) { LD_ISCSI_DPRINTF(0,"Failed to create context");