version 1.2, 1996/03/05 03:16:18 |
version 1.3, 1996/06/25 22:43:25 |
|
|
if (!msgfac->mf_fptr) { |
if (!msgfac->mf_fptr) { |
register char *cp; |
register char *cp; |
char *getenv(); |
char *getenv(); |
|
int fd; |
|
|
/* |
/* |
* Create and open a new temporary file |
* Create and open a new temporary file |
|
|
(void) sprintf(tempfile, "%s/%s", cp, _RDIST_TMP); |
(void) sprintf(tempfile, "%s/%s", cp, _RDIST_TMP); |
|
|
msgfac->mf_filename = tempfile; |
msgfac->mf_filename = tempfile; |
(void) mktemp(msgfac->mf_filename); |
if ((fd = mkstemp(msgfac->mf_filename)) == -1 || |
if ((msgfac->mf_fptr = fopen(msgfac->mf_filename, "w"))==NULL) |
(msgfac->mf_fptr = fdopen(fd, "w")) == NULL) { |
|
if (fd != -1) |
|
close(fd); |
fatalerr("Cannot open notify file for writing: %s: %s.", |
fatalerr("Cannot open notify file for writing: %s: %s.", |
msgfac->mf_filename, SYSERR); |
msgfac->mf_filename, SYSERR); |
|
} |
debugmsg(DM_MISC, "Created notify temp file '%s'", |
debugmsg(DM_MISC, "Created notify temp file '%s'", |
msgfac->mf_filename); |
msgfac->mf_filename); |
} |
} |