LOG_DBG ((LOG_SYSDEP, 95, "monitor_fopen: enter"));
monitor_fopen (const char *path, const char *mode){  FILE *fp;  int fd, flags = 0, umask = 0;  LOG_DBG ((LOG_SYSDEP, 95, "monitor_fopen: enter"));  /* Only the child process is supposed to run this.  */  if (m_state.pid)    log_fatal ("[priv] bad call to monitor_fopen");  switch (mode[0])    {    case 'r':      flags = (mode[1] == '+' ? O_RDWR : O_RDONLY);      break;    case 'w':      flags = (mode[1] == '+' ? O_RDWR : O_WRONLY) | O_CREAT | O_TRUNC;      break;    case 'a':      flags = (mode[1] == '+' ? O_RDWR : O_WRONLY) | O_CREAT | O_APPEND;      break;    default:      log_fatal ("monitor_fopen: bad call");    }  fd = monitor_open (path, flags, umask);  if (fd < 0)    return NULL;  /* Got the fd, attach a FILE * to it.  */  fp = fdopen (fd, mode);  if (!fp)    {      log_error ("monitor_fopen: fdopen() failed");      close (fd);      return NULL;    }  return fp;}