src/cmd.c: Fixed bug was caused by mmap behaviour when length = 0
Here is quote from man(3) mmap: SUSv3 specifies that mmap() should fail if length is 0. However, in kernels before 2.6.12, mmap() succeeded in this case: no mapping was created and the call returned addr. Since kernel 2.6.12, mmap() fails with the error EINVAL for this case. Thanks to snizovtsev
Этот коммит содержится в:
родитель
25d5ed8c6a
Коммит
8c441fdd12
@ -719,6 +719,9 @@ static int compare_files (char *name1, char *name2, off_t size)
|
||||
int file1, file2;
|
||||
int result = -1; /* Different by default */
|
||||
|
||||
if (size == 0)
|
||||
return 0;
|
||||
|
||||
file1 = open (name1, O_RDONLY);
|
||||
if (file1 >= 0){
|
||||
file2 = open (name2, O_RDONLY);
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user