Back to index

nagios-plugins  1.4.16
fd-safer.c File Reference
#include <config.h>
#include "unistd-safer.h"
#include <errno.h>
#include <unistd.h>

Go to the source code of this file.


int fd_safer (int fd)

Function Documentation

int fd_safer ( int  fd)

Definition at line 37 of file fd-safer.c.

  if (STDIN_FILENO <= fd && fd <= STDERR_FILENO)
      int f = dup_safer (fd);
      int e = errno;
      close (fd);
      errno = e;
      fd = f;

  return fd;

Here is the call graph for this function:

Here is the caller graph for this function: