svn commit: r295365 - user/ngie/bsnmp_cleanup/contrib/bsnmp/lib

Garrett Cooper ngie at FreeBSD.org
Sun Feb 7 05:15:53 UTC 2016


Author: ngie
Date: Sun Feb  7 05:15:51 2016
New Revision: 295365
URL: https://svnweb.freebsd.org/changeset/base/295365

Log:
  Revert r295247
  
  Changing mktemp to mkstemp breaks the bind call because mkstemp
  creates the file. Functionally, there is no difference in mktemp
  vs mkstemp + unlink, except the additional overhead, so revert
  the commit

Modified:
  user/ngie/bsnmp_cleanup/contrib/bsnmp/lib/snmpclient.c

Modified: user/ngie/bsnmp_cleanup/contrib/bsnmp/lib/snmpclient.c
==============================================================================
--- user/ngie/bsnmp_cleanup/contrib/bsnmp/lib/snmpclient.c	Sun Feb  7 04:58:06 2016	(r295364)
+++ user/ngie/bsnmp_cleanup/contrib/bsnmp/lib/snmpclient.c	Sun Feb  7 05:15:51 2016	(r295365)
@@ -1000,7 +1000,7 @@ open_client_local(const char *path)
 	snprintf(snmp_client.local_path, sizeof(snmp_client.local_path),
 	    "%s", SNMP_LOCAL_PATH);
 
-	if (mkstemp(snmp_client.local_path) == -1) {
+	if (mktemp(snmp_client.local_path) == NULL) {
 		seterr(&snmp_client, "%s", strerror(errno));
 		(void)close(snmp_client.fd);
 		snmp_client.fd = -1;


More information about the svn-src-user mailing list