Catch up with realpath(3) changes (r235266) and unbreak acpidump(8).

This commit is contained in:
Jung-uk Kim 2012-05-25 00:18:19 +00:00
parent 08c5f3303d
commit d6a6e5902f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=235948

View File

@ -1196,13 +1196,13 @@ aml_disassemble(ACPI_TABLE_HEADER *rsdt, ACPI_TABLE_HEADER *dsdp)
if (tmpdir == NULL)
tmpdir = _PATH_TMP;
strncpy(tmpstr, tmpdir, sizeof(tmpstr));
strncat(tmpstr, "/acpidump.", sizeof(tmpstr) - strlen(tmpdir));
if (realpath(tmpstr, buf) == NULL) {
perror("realpath tmp file");
perror("realpath tmp dir");
return;
}
strncpy(tmpstr, buf, sizeof(tmpstr));
len = strlen(buf);
strncat(tmpstr, "/acpidump.", sizeof(tmpstr) - strlen(buf));
len = strlen(tmpstr);
tmpext = tmpstr + len;
strncpy(tmpext, "XXXXXX", sizeof(tmpstr) - len);
fd = mkstemp(tmpstr);