fd = EopenD(file, O_RDONLY, 0);
Efstat(fd, &st);
mapping = mmap(NULL, MIN(st.st_size, MAX_PEEK_SIZE), PROT_READ, MAP_SHARED, fd, 0);
- if (!mapping) {
+ if (mapping == MAP_FAILED) {
perror("mmap()");
Eclose(fd);
return -1;
*buf = '\0';
while (1) {
- if ((eol = strchr(buf, '\n')) == NULL && (end - buf) < (sizeof(buf) - 1)) {
+ if ((eol = strchr(buf, '\n')) == NULL && (end - buf) < (signed) (sizeof(buf) - 1)) {
bytes_read = Eread(fd, end, sizeof(buf) - 1 - (end - buf));
/* EOF, implicit newline */
if (bytes_read == 0) {