Whamcloud - gitweb
libext2fs: fix incorrect negative error return in unix and sparse io managers
authorTheodore Ts'o <tytso@mit.edu>
Thu, 21 Jan 2021 21:00:01 +0000 (16:00 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 21 Jan 2021 21:00:01 +0000 (16:00 -0500)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/sparse_io.c
lib/ext2fs/unix_io.c

index 5e0e2cd..f287e76 100644 (file)
@@ -138,7 +138,7 @@ static errcode_t io_manager_configure(struct sparse_io_params *params,
        retval = io_manager_import_sparse(params, sm, io);
        if (retval) {
                if (!params->block_size || !params->blocks_count) {
-                       retval = -EINVAL;
+                       retval = EINVAL;
                        goto err_params;
                }
                sm->block_size = params->block_size;
@@ -229,7 +229,7 @@ static errcode_t read_sparse_argv(const char *name, bool is_fd,
 
        if (ret < 1) {
                free(sparse_params->file);
-               return -EINVAL;
+               return EINVAL;
        }
        return 0;
 }
index 628e60c..2bcd435 100644 (file)
@@ -733,7 +733,7 @@ static errcode_t unixfd_open(const char *str_fd, int flags,
 #if defined(HAVE_FCNTL)
        fd_flags = fcntl(fd, F_GETFD);
        if (fd_flags == -1)
-               return -EBADF;
+               return EBADF;
 
        flags = 0;
        if (fd_flags & O_RDWR)