Remove UNSAFE_WARN ifdef for mktemp warning (never defined)

Use _mktemp internally
This commit is contained in:
ache 1999-10-24 11:57:24 +00:00
parent 4f2f4b0822
commit 43719c600e
3 changed files with 6 additions and 6 deletions

View File

@ -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)

View File

@ -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;

View File

@ -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));
}