From 7f87845379f91357da013449bde082b44cfa195d Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Mon, 1 Feb 2010 15:22:31 +0000 Subject: [PATCH] - set errno on failure so that the caller can still rely on strerror (reporting wrong error w/o this change) --- TSRM/tsrm_virtual_cwd.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/TSRM/tsrm_virtual_cwd.c b/TSRM/tsrm_virtual_cwd.c index 1c5ced39f5..5a64198cd7 100644 --- a/TSRM/tsrm_virtual_cwd.c +++ b/TSRM/tsrm_virtual_cwd.c @@ -1001,6 +1001,11 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func TSRMLS_FETCH(); if (path_length == 0 || path_length >= MAXPATHLEN-1) { +#ifdef TSRM_WIN32 + _set_errno(EINVAL); +#else + errno = EINVAL +#endif return 1; } -- 2.40.0