about summary refs log tree commit diff
path: root/src/execline/fdclose.c
blob: 94972f3cc10410951f0ea7352965b23deda9b893 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* ISC license. */

#include <skalibs/types.h>
#include <skalibs/strerr2.h>
#include <skalibs/djbunix.h>
#include <skalibs/exec.h>

#define USAGE "fdclose fd prog..."

int main (int argc, char const *const *argv)
{
  unsigned int fd ;
  PROG = "fdclose" ;
  if ((argc < 3) || !uint0_scan(argv[1], &fd)) strerr_dieusage(100, USAGE) ;
  fd_close(fd) ;
  xexec(argv+2) ;
}