libxbps: open fds with O_CLOEXEC to avoid warnings of leaked fds.

This commit is contained in:
Juan RP
2015-04-15 21:02:38 +02:00
parent bc97851fdb
commit ea364affc8
3 changed files with 5 additions and 5 deletions

View File

@ -89,7 +89,7 @@ xbps_pkgdb_lock(struct xbps_handle *xhp)
return rv;
}
}
if ((pkgdb_fd = open(xhp->pkgdb_plist, O_CREAT|O_RDWR, 0664)) == -1) {
if ((pkgdb_fd = open(xhp->pkgdb_plist, O_CREAT|O_RDWR|O_CLOEXEC, 0664)) == -1) {
rv = errno;
xbps_dbg_printf(xhp, "[pkgdb] cannot open pkgdb for locking "
"%s: %s\n", xhp->pkgdb_plist, strerror(rv));