Remove UNSAFE_WARN ifdef for mktemp warning (never defined)
Use _mktemp internally
This commit is contained in:
parent
ad5952ca34
commit
490fc835e8
@ -85,10 +85,8 @@ _mktemp(path)
|
||||
return(_gettemp(path, (int *)NULL, 0, 0) ? path : (char *)NULL);
|
||||
}
|
||||
|
||||
#ifdef UNSAFE_WARN
|
||||
__warn_references(mktemp,
|
||||
"warning: mktemp() possibly used unsafely; consider using mkstemp()");
|
||||
#endif
|
||||
|
||||
char *
|
||||
mktemp(path)
|
||||
|
@ -75,18 +75,18 @@ tempnam(dir, pfx)
|
||||
if ((f = (char *)dir)) {
|
||||
(void)snprintf(name, MAXPATHLEN, "%s%s%sXXXXXX", f,
|
||||
*(f + strlen(f) - 1) == '/'? "": "/", pfx);
|
||||
if ((f = mktemp(name)))
|
||||
if ((f = _mktemp(name)))
|
||||
return(f);
|
||||
}
|
||||
|
||||
f = P_tmpdir;
|
||||
(void)snprintf(name, MAXPATHLEN, "%s%sXXXXXX", f, pfx);
|
||||
if ((f = mktemp(name)))
|
||||
if ((f = _mktemp(name)))
|
||||
return(f);
|
||||
|
||||
f = _PATH_TMP;
|
||||
(void)snprintf(name, MAXPATHLEN, "%s%sXXXXXX", f, pfx);
|
||||
if ((f = mktemp(name)))
|
||||
if ((f = _mktemp(name)))
|
||||
return(f);
|
||||
|
||||
sverrno = errno;
|
||||
|
@ -32,6 +32,8 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
@ -59,5 +61,5 @@ tmpnam(s)
|
||||
s = buf;
|
||||
(void)snprintf(s, L_tmpnam, "%stmp.%lu.XXXXXX", P_tmpdir, tmpcount);
|
||||
++tmpcount;
|
||||
return (mktemp(s));
|
||||
return (_mktemp(s));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user