lib/package_script.c: misc cleanups.

This commit is contained in:
Juan RP 2013-08-29 12:13:59 +02:00
parent 20fb38142b
commit 1bea5725ae

View File

@ -72,18 +72,18 @@ xbps_pkg_exec_buffer(struct xbps_handle *xhp,
/* Create temp file to run script */
if ((fd = mkstemp(fpath)) == -1) {
rv = errno;
xbps_dbg_printf(xhp, "%s: mkstemp %s\n",
__func__, strerror(errno));
free(fpath);
return errno;
goto out;
}
/* write blob to our temp fd */
ret = write(fd, blob, blobsiz);
if (ret == -1) {
rv = errno;
xbps_dbg_printf(xhp, "%s: write %s\n",
__func__, strerror(errno));
close(fd);
rv = errno;
goto out;
}
fchmod(fd, 0750);