From 5cd230ac74d9c8fb722d282768d634aaae7f66df Mon Sep 17 00:00:00 2001 From: Mike Gilbert Date: Sun, 29 Oct 2017 20:26:53 -0400 Subject: [PATCH] winpr: _IoCreateDeviceEx: fix mkdir error check The mkdir(2) function returns 0 on success, and -1 on error. This resolves an error in TestIoDevice when /tmp/.device/ does not exist. Bug: https://bugs.gentoo.org/635838 --- winpr/libwinpr/io/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winpr/libwinpr/io/device.c b/winpr/libwinpr/io/device.c index 0e13092..2a1b7f8 100644 --- a/winpr/libwinpr/io/device.c +++ b/winpr/libwinpr/io/device.c @@ -138,7 +138,7 @@ NTSTATUS _IoCreateDeviceEx(PDRIVER_OBJECT_EX DriverObject, ULONG DeviceExtension if (!PathFileExistsA(DeviceBasePath)) { - if (!mkdir(DeviceBasePath, S_IRUSR | S_IWUSR | S_IXUSR)) + if (mkdir(DeviceBasePath, S_IRUSR | S_IWUSR | S_IXUSR) != 0) { free(DeviceBasePath); return STATUS_ACCESS_DENIED; -- 2.7.4