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

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

No files matched your search

+1 -1
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));