Blame SOURCES/e2fsprogs-1.45.6-libext2fs-fix-incorrect-negative-error-return-in-uni.patch

a77133
From c951a12b1594158bb87fbc4d8a89b326c34e711f Mon Sep 17 00:00:00 2001
a77133
From: Theodore Ts'o <tytso@mit.edu>
a77133
Date: Thu, 21 Jan 2021 16:00:01 -0500
a77133
Subject: [PATCH 15/46] libext2fs: fix incorrect negative error return in unix
a77133
 and sparse io managers
a77133
Content-Type: text/plain
a77133
a77133
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
a77133
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
a77133
---
a77133
 lib/ext2fs/sparse_io.c | 4 ++--
a77133
 lib/ext2fs/unix_io.c   | 2 +-
a77133
 2 files changed, 3 insertions(+), 3 deletions(-)
a77133
a77133
diff --git a/lib/ext2fs/sparse_io.c b/lib/ext2fs/sparse_io.c
a77133
index 5e0e2cd9..f287e76d 100644
a77133
--- a/lib/ext2fs/sparse_io.c
a77133
+++ b/lib/ext2fs/sparse_io.c
a77133
@@ -138,7 +138,7 @@ static errcode_t io_manager_configure(struct sparse_io_params *params,
a77133
 	retval = io_manager_import_sparse(params, sm, io);
a77133
 	if (retval) {
a77133
 		if (!params->block_size || !params->blocks_count) {
a77133
-			retval = -EINVAL;
a77133
+			retval = EINVAL;
a77133
 			goto err_params;
a77133
 		}
a77133
 		sm->block_size = params->block_size;
a77133
@@ -229,7 +229,7 @@ static errcode_t read_sparse_argv(const char *name, bool is_fd,
a77133
 
a77133
 	if (ret < 1) {
a77133
 		free(sparse_params->file);
a77133
-		return -EINVAL;
a77133
+		return EINVAL;
a77133
 	}
a77133
 	return 0;
a77133
 }
a77133
diff --git a/lib/ext2fs/unix_io.c b/lib/ext2fs/unix_io.c
a77133
index 628e60c3..2bcd435c 100644
a77133
--- a/lib/ext2fs/unix_io.c
a77133
+++ b/lib/ext2fs/unix_io.c
a77133
@@ -733,7 +733,7 @@ static errcode_t unixfd_open(const char *str_fd, int flags,
a77133
 #if defined(HAVE_FCNTL)
a77133
 	fd_flags = fcntl(fd, F_GETFD);
a77133
 	if (fd_flags == -1)
a77133
-		return -EBADF;
a77133
+		return EBADF;
a77133
 
a77133
 	flags = 0;
a77133
 	if (fd_flags & O_RDWR)
a77133
-- 
a77133
2.35.1
a77133