Commit 4c408e79 authored by Changpeng Liu's avatar Changpeng Liu Committed by Jim Harris
Browse files

rocksdb: set errno to support Myrocks engine



Myrocks engine uses errno(ENOENT) as one of the condition
to create new database, this is okay for POSIX environment,
to support MySQL, spdk environment layer set errno to right
value as well.

Change-Id: Ib633f915ffafde0eacc0a8a0c451e510396d9176
Signed-off-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/369320


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 4ce7dd66
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -293,7 +293,12 @@ public:
				result->reset(new SpdkSequentialFile(file));
				return Status::OK();
			} else {
				return IOError(fname, rc);
				/* Myrocks engine uses errno(ENOENT) as one
				 * special condition, for the purpose to
				 * support MySQL, set the errno to right value.
				 */
				errno = -rc;
				return IOError(fname, errno);
			}
		} else {
			return PosixEnv::NewSequentialFile(fname, result, options);