aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/fileio.c
diff options
context:
space:
mode:
authorMichael Reed <Pyrohh@users.noreply.github.com>2015-11-25 19:52:33 -0500
committerMichael Reed <Pyrohh@users.noreply.github.com>2015-11-25 19:52:33 -0500
commitd3dbaa321b86bd35e12e759590418e3fbe1929ae (patch)
tree8f8eb05cc5ae6d4bdc2d1325a40af8c82f49fc20 /src/nvim/fileio.c
parent4f24b9e06f59592c120dd6d5c1e7f0f4a53b23f1 (diff)
parentd873084581c5c94d2a910aea8561ea1d64eeafbd (diff)
downloadrneovim-d3dbaa321b86bd35e12e759590418e3fbe1929ae.tar.gz
rneovim-d3dbaa321b86bd35e12e759590418e3fbe1929ae.tar.bz2
rneovim-d3dbaa321b86bd35e12e759590418e3fbe1929ae.zip
Merge pull request #3531 from equalsraf/tb-cleanup-os-errors
[RFC] Cleanup use of os_* functions errors and errno
Diffstat (limited to 'src/nvim/fileio.c')
-rw-r--r--src/nvim/fileio.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index c07597df47..4aa4d4c399 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -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 */