-/* $OpenBSD: ypxfr.c,v 1.9 1996/10/01 01:53:08 deraadt Exp $ */
+/* $OpenBSD: ypxfr.c,v 1.10 1996/12/24 19:28:03 deraadt Exp $ */
/*
* Copyright (c) 1994 Mats O Jansson <moj@stacken.kth.se>
*/
#ifndef LINT
-static char rcsid[] = "$OpenBSD: ypxfr.c,v 1.9 1996/10/01 01:53:08 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: ypxfr.c,v 1.10 1996/12/24 19:28:03 deraadt Exp $";
#endif
#include <stdio.h>
}
if (status == YPPUSH_SUCC) {
+ int fd;
/* Create temporary db */
- mktemp(mapname);
- db = create_db(domain,map,mapname);
- if(db == NULL) {
+ fd = mkstemp(mapname);
+ if (fd == -1)
status = YPPUSH_DBM;
+ else
+ close(fd);
+
+ if (status > 0) {
+ db = create_db(domain,map,mapname);
+ if(db == NULL)
+ status = YPPUSH_DBM;
}
/* Add ORDER */