diff options
Diffstat (limited to 'src/nvim/fileio.c')
-rw-r--r-- | src/nvim/fileio.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index a7472b40e2..4aa4d4c399 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -3,7 +3,7 @@ * * Do ":help uganda" in Vim to read copying and usage conditions. * Do ":help credits" in Vim to see a list of people who contributed. - * See README.txt for an overview of the Vim source code. + * See README.md for an overview of the Vim source code. */ /* @@ -535,11 +535,7 @@ readfile ( if (!newfile) { return FAIL; } - if (perm < 0 -#ifdef ENOENT - && errno == ENOENT -#endif - ) { + if (perm == UV_ENOENT) { /* * Set the 'new-file' flag, so that when the file has * been created by someone else, a ":w" will complain. @@ -582,11 +578,11 @@ readfile ( return OK; /* a new file is not an error */ } else { filemess(curbuf, sfname, (char_u *)( -# ifdef EFBIG - (errno == EFBIG) ? _("[File too big]") : -# endif -# ifdef EOVERFLOW - (errno == EOVERFLOW) ? _("[File too big]") : + (fd == UV_EFBIG) ? _("[File too big]") : +# if defined(UNIX) && defined(EOVERFLOW) + // libuv only returns -errno in Unix and in Windows open() does not + // set EOVERFLOW + (fd == -EOVERFLOW) ? _("[File too big]") : # endif _("[Permission Denied]")), 0); curbuf->b_p_ro = TRUE; /* must use "w!" now */ |