version 1.83, 2015/11/05 09:48:21 |
version 1.84, 2016/10/15 22:20:17 |
|
|
if (lseek(fd, 0, SEEK_SET) == -1) |
if (lseek(fd, 0, SEEK_SET) == -1) |
fatal("buf_load_fd: lseek: %s", strerror(errno)); |
fatal("buf_load_fd: lseek: %s", strerror(errno)); |
|
|
if (st.st_size > SIZE_MAX) |
if ((uintmax_t)st.st_size > SIZE_MAX) |
fatal("buf_load_fd: file size too big"); |
fatal("buf_load_fd: file size too big"); |
buf = buf_alloc(st.st_size); |
buf = buf_alloc(st.st_size); |
if (atomicio(read, fd, buf->cb_buf, buf->cb_size) != buf->cb_size) |
if (atomicio(read, fd, buf->cb_buf, buf->cb_size) != buf->cb_size) |