From 034ec3e66484f86f28c16434eccc35890bb79e2a Mon Sep 17 00:00:00 2001 From: jvazquez-r7 Date: Tue, 8 Jul 2014 12:12:45 -0500 Subject: [PATCH] Return errno when fopen fails --- source/extensions/stdapi/server/fs/file.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/extensions/stdapi/server/fs/file.c b/source/extensions/stdapi/server/fs/file.c index 3458c0a..4266910 100644 --- a/source/extensions/stdapi/server/fs/file.c +++ b/source/extensions/stdapi/server/fs/file.c @@ -175,7 +175,11 @@ DWORD request_fs_file_channel_open(Remote *remote, Packet *packet) // Invalid file? if (!(ctx->fd = fopen(expandedFilePath, mode))) { +#ifdef _WIN32 res = GetLastError(); +#else + res = errno; +#endif break; }