Beispiel #1
0
static guestfs_int_isoinfo *
isoinfo (const char *path)
{
  char *out = NULL, *err = NULL;
  int r;
  char **lines = NULL;
  guestfs_int_isoinfo *ret = NULL;

  /* --debug is necessary to get additional fields, in particular
   * the date & time fields.
   */
  r = command (&out, &err, str_isoinfo, "--debug", "-d", "-i", path, NULL);
  if (r == -1) {
    reply_with_error ("%s", err);
    goto done;
  }

  lines = split_lines (out);
  if (lines == NULL)
    goto done;

  ret = parse_isoinfo (lines);
  if (ret == NULL)
    goto done;

 done:
  free (out);
  free (err);
  if (lines)
    free_strings (lines);

  return ret;
}
Beispiel #2
0
static guestfs_int_isoinfo *
isoinfo (const char *path)
{
  int r;
  CLEANUP_FREE char *out = NULL, *err = NULL;
  CLEANUP_FREE_STRING_LIST char **lines = NULL;

  /* --debug is necessary to get additional fields, in particular
   * the date & time fields.
   */
  r = command (&out, &err, "isoinfo", "--debug", "-d", "-i", path, NULL);
  if (r == -1) {
    reply_with_error ("%s", err);
    return NULL;
  }

  lines = split_lines (out);
  if (lines == NULL)
    return NULL;

  return parse_isoinfo (lines);
}