summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1999-05-30 08:20:51 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1999-05-30 08:20:51 +0000
commita9145375d938c4426d115377feb3bc10d6d3feea (patch)
tree47fcde9adc617d588848454efc4b72f780443b96 /usr.sbin
parent4f081102b7647bc4d2cbd38102289bb9f93aad13 (diff)
check mkstemp() failure
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/dhcp/dhclient/dhclient.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/dhcp/dhclient/dhclient.c b/usr.sbin/dhcp/dhclient/dhclient.c
index 2dc041efef0..69b6ec08d0a 100644
--- a/usr.sbin/dhcp/dhclient/dhclient.c
+++ b/usr.sbin/dhcp/dhclient/dhclient.c
@@ -56,7 +56,7 @@
#ifndef lint
static char copyright[] =
-"$Id: dhclient.c,v 1.3 1999/02/11 22:49:59 deraadt Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
+"$Id: dhclient.c,v 1.4 1999/05/30 08:20:50 deraadt Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -1793,6 +1793,11 @@ void script_init (ip, reason, medium)
} while (fd < 0);
#endif
+#ifdef HAVE_MKSTEMP
+ if (fd == -1)
+ error ("can't write script file: %m");
+#endif
+
scriptFile = fdopen (fd, "w");
if (!scriptFile)
error ("can't write script file: %m");