• kaa@polly.(none)'s avatar
    Fix for bug #31566: my_write(fd, 0x0, 0, flags) fails with EFAULT on · 78aa6599
    kaa@polly.(none) authored
    some platforms
    
    Since the behavior of write(fd, buf, 0) is undefined, it may fail with
    EFAULT on some architectures when buf == NULL. The error was propagated
    up to a caller, since my_write() code did not handle it properly.
    
    Fixed by checking the 'number of bytes' argument in my_write() and
    returning before calling the write() system call when there is nothing
    to write.
    78aa6599
my_write.c 2.95 KB