lib/package_script.c: misc cleanups.
This commit is contained in:
parent
20fb38142b
commit
1bea5725ae
@ -72,18 +72,18 @@ xbps_pkg_exec_buffer(struct xbps_handle *xhp,
|
|||||||
|
|
||||||
/* Create temp file to run script */
|
/* Create temp file to run script */
|
||||||
if ((fd = mkstemp(fpath)) == -1) {
|
if ((fd = mkstemp(fpath)) == -1) {
|
||||||
|
rv = errno;
|
||||||
xbps_dbg_printf(xhp, "%s: mkstemp %s\n",
|
xbps_dbg_printf(xhp, "%s: mkstemp %s\n",
|
||||||
__func__, strerror(errno));
|
__func__, strerror(errno));
|
||||||
free(fpath);
|
goto out;
|
||||||
return errno;
|
|
||||||
}
|
}
|
||||||
/* write blob to our temp fd */
|
/* write blob to our temp fd */
|
||||||
ret = write(fd, blob, blobsiz);
|
ret = write(fd, blob, blobsiz);
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
|
rv = errno;
|
||||||
xbps_dbg_printf(xhp, "%s: write %s\n",
|
xbps_dbg_printf(xhp, "%s: write %s\n",
|
||||||
__func__, strerror(errno));
|
__func__, strerror(errno));
|
||||||
close(fd);
|
close(fd);
|
||||||
rv = errno;
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
fchmod(fd, 0750);
|
fchmod(fd, 0750);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user