浏览代码

common/sendfile.c: bugfix can't support offset is NULL

In ltp testcase sendfile08.c, it use offset=NULL to test the api.

See "man sendfile" and it really support offset is NULL.

Signed-off-by: Guo Ren <ren_guo@c-sky.com>
Guo Ren 6 年之前
父节点
当前提交
b00fd230ed
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      libc/sysdeps/linux/common/sendfile.c

+ 1 - 1
libc/sysdeps/linux/common/sendfile.c

@@ -40,7 +40,7 @@ ssize_t sendfile(int out_fd, int in_fd, __off_t *offset, size_t count)
 		return -1;
 	}
 
-	if (offset == NULL || (int)offset < 0) {
+	if ((int)offset < 0) {
 		__set_errno(EFAULT);
 		return -1;
 	}