Date: Sun, 12 Aug 2012 23:38:22 -0400 From: Jason Hellenthal <jhellenthal@dataix.net> To: ports@freebsd.org Cc: Julien Laffaye <jlaffaye@freebsd.org> Subject: line 91 of [github] pkgng libpkg/update.c (use: mkstemp inplace of mktemp) Message-ID: <20120813033822.GA37015@DataIX.net>
next in thread | raw e-mail | index | archive | help
--VS++wcV0S1rZb1Fb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Yeah yeah I know mkstemp instead of mkstemp ??? we already do strlcpy in place. But why not DTRT... On the same subject of /tmp As well should we not be attempting to get environ(7) TMPDIR and honor it throughout all of pkgng ? Added verbage: (off topic) Also line 4 & 14 have an extra space after the asterisks(*) Anyway... nice work on pkgng folks, keep up the AWESOME! work. -- - (2^(N-1)) JJH48-ARIN --VS++wcV0S1rZb1Fb Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="mkstemp.diff" diff --git a/libpkg/update.c b/libpkg/update.c index 0ede23c..942b6b7 100644 --- a/libpkg/update.c +++ b/libpkg/update.c @@ -88,7 +88,7 @@ pkg_update(const char *name, const char *packagesite, bool force) snprintf(url, MAXPATHLEN, "%s/repo.txz", packagesite); (void)strlcpy(tmp, "/tmp/repo.txz.XXXXXX", sizeof(tmp)); - if (mktemp(tmp) == NULL) { + if (mkstemp(tmp) == -1) { pkg_emit_error("Could not create temporary file %s, " "aborting update.\n", tmp); return (EPKG_FATAL); --VS++wcV0S1rZb1Fb--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120813033822.GA37015>