-/* $NetBSD: bill.c,v 1.8 2008/01/28 05:38:53 dholland Exp $ */
+/* $NetBSD: bill.c,v 1.9 2008/02/03 03:49:15 dholland Exp $ */
/*-
* Copyright (c) 1991 The Regents of the University of California.
#if 0
static char sccsid[] = "@(#)bill.c 5.2 (Berkeley) 5/28/91";
#else
-__RCSID("$NetBSD: bill.c,v 1.8 2008/01/28 05:38:53 dholland Exp $");
+__RCSID("$NetBSD: bill.c,v 1.9 2008/02/03 03:49:15 dholland Exp $");
#endif
#endif /* not lint */
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
+#include <paths.h>
#include "header.h"
#include "extern.h"
if (fork() == 0) {
resetscroll();
cp = mail;
- snprintf(fname, sizeof(fname), "/tmp/#%dlarnmail", getpid());
+ snprintf(fname, sizeof(fname), "%slarnmail.XXXXXX", _PATH_TMP);
for (i = 0; i < 6; i++) {
- if ((fd = open(fname, O_WRONLY | O_TRUNC | O_CREAT,
- 0666)) == -1)
+ if ((fd = mkstemp(fname)) == -1)
exit(0);
while (*cp != NULL) {
if (*cp[0] == '1') {