Use a better name than underscore-tmpfile for better representation
of the meaning. Suggested by: stefanf
This commit is contained in:
parent
f52cd9a81d
commit
d7e35203c7
@ -402,7 +402,7 @@ buildhints()
|
|||||||
int strtab_sz = 0; /* Total length of strings */
|
int strtab_sz = 0; /* Total length of strings */
|
||||||
int nhints = 0; /* Total number of hints */
|
int nhints = 0; /* Total number of hints */
|
||||||
int fd;
|
int fd;
|
||||||
char *_tmpfile;
|
char *tmpfilename;
|
||||||
|
|
||||||
for (shp = shlib_head; shp; shp = shp->next) {
|
for (shp = shlib_head; shp; shp = shp->next) {
|
||||||
strtab_sz += 1 + strlen(shp->name);
|
strtab_sz += 1 + strlen(shp->name);
|
||||||
@ -482,10 +482,10 @@ buildhints()
|
|||||||
errx(1, "str_index(%d) != strtab_sz(%d)", str_index, strtab_sz);
|
errx(1, "str_index(%d) != strtab_sz(%d)", str_index, strtab_sz);
|
||||||
}
|
}
|
||||||
|
|
||||||
_tmpfile = concat(hints_file, ".XXXXXXXXXX", "");
|
tmpfilename = concat(hints_file, ".XXXXXXXXXX", "");
|
||||||
umask(0); /* Create with exact permissions */
|
umask(0); /* Create with exact permissions */
|
||||||
if ((fd = mkstemp(_tmpfile)) == -1) {
|
if ((fd = mkstemp(tmpfilename)) == -1) {
|
||||||
warn("%s", _tmpfile);
|
warn("%s", tmpfilename);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
fchmod(fd, 0444);
|
fchmod(fd, 0444);
|
||||||
@ -515,7 +515,7 @@ buildhints()
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rename(_tmpfile, hints_file) != 0) {
|
if (rename(tmpfilename, hints_file) != 0) {
|
||||||
warn("%s", hints_file);
|
warn("%s", hints_file);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user