mirror of
https://github.com/torvalds/linux.git
synced 2025-12-01 07:26:02 +07:00
uio: make import_iovec()/compat_import_iovec() return bytes on success
Currently these functions return < 0 on error, and 0 for success. Change that so that we return < 0 on error, but number of bytes for success. Some callers already treat the return value that way, others need a slight tweak. Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
@@ -80,9 +80,10 @@ int get_compat_msghdr(struct msghdr *kmsg,
|
||||
|
||||
kmsg->msg_iocb = NULL;
|
||||
|
||||
return compat_import_iovec(save_addr ? READ : WRITE,
|
||||
err = compat_import_iovec(save_addr ? READ : WRITE,
|
||||
compat_ptr(msg.msg_iov), msg.msg_iovlen,
|
||||
UIO_FASTIOV, iov, &kmsg->msg_iter);
|
||||
return err < 0 ? err : 0;
|
||||
}
|
||||
|
||||
/* Bleech... */
|
||||
|
||||
Reference in New Issue
Block a user