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

@ -1,5 +1,5 @@
/*-
* Copyright (c) 2008-2014 Juan Romero Pardines.
* Copyright (c) 2008-2015 Juan Romero Pardines.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -69,7 +69,7 @@ xbps_mmap_file(const char *file, void **mmf, size_t *mmflen, size_t *filelen)
assert(file);
if ((fd = open(file, O_RDONLY)) == -1)
if ((fd = open(file, O_RDONLY|O_CLOEXEC)) == -1)
return false;
if (fstat(fd, &st) == -1) {