1 |
– |
/* Copyright (c) 1992 Regents of the University of California */ |
2 |
– |
|
1 |
|
#ifndef lint |
2 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
6 |
– |
|
4 |
|
/* |
5 |
|
* Replacement mktemp(3) function for systems without |
6 |
|
*/ |
7 |
|
|
8 |
< |
#include "standard.h" |
8 |
> |
#include "copyright.h" |
9 |
|
|
10 |
+ |
#ifndef NULL |
11 |
+ |
#define NULL 0 |
12 |
+ |
#endif |
13 |
|
|
14 |
+ |
|
15 |
|
char * |
16 |
|
mktemp(template) /* make a unique filename from template */ |
17 |
|
char *template; |
36 |
|
} |
37 |
|
p = te-1; /* final character */ |
38 |
|
for (*p = 'a'; *p <= 'z'; (*p)++) |
39 |
< |
if (access(template, F_OK) == -1) |
39 |
> |
if (access(template, 0) == -1) |
40 |
|
return(template); /* found unique name */ |
41 |
|
return(NULL); /* failure! */ |
42 |
|
} |