Exit with an error if a linker hints file can't be found.

Continuing with a NULL hints variable just triggers a segfault later on.
The other error cases in this function all exit for an error rather than
warning.

Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D15579
This commit is contained in:
John Baldwin 2018-06-14 22:31:30 +00:00
parent 9293873e83
commit 44a230cd92

View File

@ -120,12 +120,8 @@ read_linker_hints(void)
continue; continue;
break; break;
} }
if (q == NULL) { if (q == NULL)
warnx("Can't read linker hints file."); errx(1, "Can't read linker hints file.");
free(hints);
hints = NULL;
return;
}
} else { } else {
hints = read_hints(linker_hints, &len); hints = read_hints(linker_hints, &len);
if (hints == NULL) if (hints == NULL)