Allow install(1)'s create_tempfile() to work on Linux hosts
GLibc expects six 'X' characters in the mkstemp template argument and will return EINVAL otherwise. Reviewed By: emaste, imp, mjg Differential Revision: https://reviews.freebsd.org/D25662
This commit is contained in:
@@ -301,8 +301,8 @@ This is mainly for use in debugging the
|
|||||||
.Fx
|
.Fx
|
||||||
Ports Collection.
|
Ports Collection.
|
||||||
.Sh FILES
|
.Sh FILES
|
||||||
.Bl -tag -width "INS@XXXX" -compact
|
.Bl -tag -width "INS@XXXXXX" -compact
|
||||||
.It Pa INS@XXXX
|
.It Pa INS@XXXXXX
|
||||||
If either
|
If either
|
||||||
.Fl S
|
.Fl S
|
||||||
option is specified, or the
|
option is specified, or the
|
||||||
@@ -312,9 +312,9 @@ or
|
|||||||
option is used in conjunction with the
|
option is used in conjunction with the
|
||||||
.Fl s
|
.Fl s
|
||||||
option, temporary files named
|
option, temporary files named
|
||||||
.Pa INS@XXXX ,
|
.Pa INS@XXXXXX ,
|
||||||
where
|
where
|
||||||
.Pa XXXX
|
.Pa XXXXXX
|
||||||
is decided by
|
is decided by
|
||||||
.Xr mkstemp 3 ,
|
.Xr mkstemp 3 ,
|
||||||
are created in the target directory.
|
are created in the target directory.
|
||||||
|
|||||||
@@ -1161,7 +1161,7 @@ create_tempfile(const char *path, char *temp, size_t tsize)
|
|||||||
p++;
|
p++;
|
||||||
else
|
else
|
||||||
p = temp;
|
p = temp;
|
||||||
(void)strncpy(p, "INS@XXXX", &temp[tsize - 1] - p);
|
(void)strncpy(p, "INS@XXXXXX", &temp[tsize - 1] - p);
|
||||||
temp[tsize - 1] = '\0';
|
temp[tsize - 1] = '\0';
|
||||||
return (mkstemp(temp));
|
return (mkstemp(temp));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user