WMII Reforge  Artifact [0a6c80468f]

Artifact 0a6c80468f4ae5c1164fb1f893cbb63c3e4ad406ceda4c5db4289de2e0ad504b:

  • File lib/libstuff/util/closeexec.c — part of check-in [15eae1e8e6] at 2019-06-20 16:42:23 on branch trunk — Import sources to have something to work with (user: KhazAkar size: 280)

/* Copyright ©2008-2010 Kris Maglione <maglione.k at Gmail>
 * See LICENSE file for license details.
 */
#include <unistd.h>
#include <fcntl.h>
#include "util.h"

void
closeexec(int fd) {
	if(fcntl(fd, F_SETFD, FD_CLOEXEC) == -1)
		fatal("can't set %d close on exec: %r", fd);
}