Back to index

nagios-plugins  1.4.16
open-safer.c File Reference
#include <config.h>
#include "fcntl-safer.h"
#include <fcntl.h>
#include <stdarg.h>
#include "unistd-safer.h"

Go to the source code of this file.


int open_safer (char const *file, int flags,...)

Function Documentation

int open_safer ( char const file,
int  flags,

Definition at line 29 of file open-safer.c.

  mode_t mode = 0;

  if (flags & O_CREAT)
      va_list ap;
      va_start (ap, flags);

      /* We have to use PROMOTED_MODE_T instead of mode_t, otherwise GCC 4
         creates crashing code when 'mode_t' is smaller than 'int'.  */
      mode = va_arg (ap, PROMOTED_MODE_T);

      va_end (ap);

  return fd_safer (open (file, flags, mode));

Here is the call graph for this function: