monitor_close (fd);
close (fd);
policy_init (void){  char *ptr, *policy_file;  char **asserts;  size_t sz;  int fd, len, i;  LOG_DBG ((LOG_POLICY, 30, "policy_init: initializing"));  /* Get policy file from configuration.  */  policy_file = conf_get_str ("General", "Policy-file");  if (!policy_file)    policy_file = CONF_DFLT_POLICY_FILE;  /* Check file modes and collect file size */  if (check_file_secrecy (policy_file, &sz))    log_fatal ("policy_init: cannot read %s", policy_file);  /* Open policy file.  */  fd = monitor_open (policy_file, O_RDONLY, 0);  if (fd == -1)    log_fatal ("policy_init: open (\"%s\", O_RDONLY) failed", policy_file);  /* Allocate memory to keep policies.  */  ptr = calloc (sz + 1, sizeof (char));  if (!ptr)    log_fatal ("policy_init: calloc (%lu, %lu) failed", (unsigned long)sz + 1,	       (unsigned long)sizeof (char));  /* Just in case there are short reads...  */  for (len = 0; len < sz; len += i)    {      i = read (fd, ptr + len, sz - len);      if (i == -1)	log_fatal ("policy_init: read (%d, %p, %lu) failed", fd, ptr + len,		   (unsigned long)(sz - len));    }  /* We're done with this.  */  monitor_close (fd);  /* Parse buffer, break up into individual policies.  */  asserts = kn_read_asserts (ptr, sz, &i);  /* Begone!  */  free (ptr);  if (asserts == (char **) NULL)    log_print ("policy_init: all policies flushed");  /* Cleanup */  if (keynote_policy_asserts)    {      for (fd = 0; fd < keynote_policy_asserts_num; fd++)        if (keynote_policy_asserts && keynote_policy_asserts[fd])          free (keynote_policy_asserts[fd]);      free (keynote_policy_asserts);    }  keynote_policy_asserts = asserts;  keynote_policy_asserts_num = i;}