From cc09e77a94e6e2502c9aba8572984370a55b93f7 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 18 Oct 2017 10:17:55 -0600 Subject: [PATCH] fs/vfs: Fix after recent changes. write() was return negative values in errno. Noted by Jussi Kivilinna. --- fs/vfs/fs_write.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/vfs/fs_write.c b/fs/vfs/fs_write.c index f5f9f47438..4d62cb0d98 100644 --- a/fs/vfs/fs_write.c +++ b/fs/vfs/fs_write.c @@ -246,7 +246,7 @@ ssize_t write(int fd, FAR const void *buf, size_t nbytes) ret = nx_write(fd, buf, nbytes); if (ret < 0) { - set_errno(ret); + set_errno(-ret); ret = ERROR; }