File: exec.c

package info (click to toggle)
tracker-miners 3.8.2-4
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 16,656 kB
  • sloc: ansic: 59,413; python: 3,774; xml: 261; perl: 106; sh: 62; makefile: 53
file content (32 lines) | stat: -rw-r--r-- 905 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <libtracker-extract/tracker-extract.h>

#include <fcntl.h>

G_MODULE_EXPORT gboolean
tracker_extract_get_metadata (TrackerExtractInfo  *info,
                              GError             **error)
{
	TrackerResource *resource;
	g_autoptr (GError) inner_error = NULL;
	int wait_status;
	gboolean retval;

	/* Check that child processes are also constrained */
	if (g_spawn_command_line_sync ("/bin/true",
	                               NULL, NULL, &wait_status,
	                               NULL)) {
		retval = g_spawn_check_wait_status (wait_status, &inner_error);
		if (retval)
			goto fail;
		if (!inner_error)
			goto fail;
	}

	return TRUE;
 fail:
	/* Hint unexpected success with a fail:// resource */
	resource = tracker_resource_new ("fail://");
	tracker_resource_add_uri (resource, "rdf:type", "rdfs:Resource");
	tracker_extract_info_set_resource (info, resource);
	return TRUE;
}