summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/mktemp.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdio/mktemp.c')
-rw-r--r--lib/libc/stdio/mktemp.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/libc/stdio/mktemp.c b/lib/libc/stdio/mktemp.c
index 6cedd6a..bc4c928 100644
--- a/lib/libc/stdio/mktemp.c
+++ b/lib/libc/stdio/mktemp.c
@@ -32,7 +32,11 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
+#if 0
static char sccsid[] = "@(#)mktemp.c 8.1 (Berkeley) 6/4/93";
+#endif
+static const char rcsid[] =
+ "$Id$";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -41,9 +45,11 @@ static char sccsid[] = "@(#)mktemp.c 8.1 (Berkeley) 6/4/93";
#include <errno.h>
#include <stdio.h>
#include <ctype.h>
+#include <unistd.h>
-static int _gettemp();
+static int _gettemp(char *, int *);
+int
mkstemp(path)
char *path;
{
@@ -59,15 +65,14 @@ mktemp(path)
return(_gettemp(path, (int *)NULL) ? path : (char *)NULL);
}
-static
+static int
_gettemp(path, doopen)
char *path;
register int *doopen;
{
- extern int errno;
register char *start, *trv;
struct stat sbuf;
- u_int pid;
+ pid_t pid;
pid = getpid();
for (trv = path; *trv; ++trv); /* extra X's get set to 0's */
OpenPOWER on IntegriCloud