tracker r2888 - in trunk: . src/libtracker-common src/tracker-indexer
- From: mottela svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2888 - in trunk: . src/libtracker-common src/tracker-indexer
- Date: Fri, 6 Feb 2009 14:03:18 +0000 (UTC)
Author: mottela
Date: Fri Feb 6 14:03:18 2009
New Revision: 2888
URL: http://svn.gnome.org/viewvc/tracker?rev=2888&view=rev
Log:
Removed a timeout for tracker-extract
Modified:
trunk/ChangeLog
trunk/src/libtracker-common/tracker-os-dependant-unix.c
trunk/src/tracker-indexer/tracker-module-metadata-utils.c
Modified: trunk/src/libtracker-common/tracker-os-dependant-unix.c
==============================================================================
--- trunk/src/libtracker-common/tracker-os-dependant-unix.c (original)
+++ trunk/src/libtracker-common/tracker-os-dependant-unix.c Fri Feb 6 14:03:18 2009
@@ -45,7 +45,7 @@
g_return_val_if_fail (argv != NULL, FALSE);
g_return_val_if_fail (argv[0] != NULL, FALSE);
- g_return_val_if_fail (timeout > 0, FALSE);
+ g_return_val_if_fail (timeout >= 0, FALSE);
flags = G_SPAWN_SEARCH_PATH |
G_SPAWN_STDERR_TO_DEV_NULL;
@@ -89,7 +89,7 @@
g_return_val_if_fail (argv != NULL, FALSE);
g_return_val_if_fail (argv[0] != NULL, FALSE);
- g_return_val_if_fail (timeout > 0, FALSE);
+ g_return_val_if_fail (timeout >= 0, FALSE);
g_return_val_if_fail (pid != NULL, FALSE);
result = g_spawn_async_with_pipes (NULL,
@@ -132,13 +132,20 @@
struct rlimit cpu_limit;
gint timeout = GPOINTER_TO_INT (user_data);
- /* set cpu limit */
- getrlimit (RLIMIT_CPU, &cpu_limit);
- cpu_limit.rlim_cur = timeout;
- cpu_limit.rlim_max = timeout + 1;
+ if (timeout > 0) {
+ /* set cpu limit */
+ getrlimit (RLIMIT_CPU, &cpu_limit);
+ cpu_limit.rlim_cur = timeout;
+ cpu_limit.rlim_max = timeout + 1;
+
+ if (setrlimit (RLIMIT_CPU, &cpu_limit) != 0) {
+ g_critical ("Failed to set resource limit for CPU");
+ }
- if (setrlimit (RLIMIT_CPU, &cpu_limit) != 0) {
- g_critical ("Failed to set resource limit for CPU");
+ /* Have this as a precaution in cases where cpu limit has not
+ * been reached due to spawned app sleeping.
+ */
+ alarm (timeout + 2);
}
tracker_memory_setrlimits ();
@@ -154,11 +161,6 @@
if (nice (19) == -1 && errno) {
g_warning ("Failed to set nice value");
}
-
- /* Have this as a precaution in cases where cpu limit has not
- * been reached due to spawned app sleeping.
- */
- alarm (timeout + 2);
}
gchar *
Modified: trunk/src/tracker-indexer/tracker-module-metadata-utils.c
==============================================================================
--- trunk/src/tracker-indexer/tracker-module-metadata-utils.c (original)
+++ trunk/src/tracker-indexer/tracker-module-metadata-utils.c Fri Feb 6 14:03:18 2009
@@ -130,7 +130,7 @@
GPid pid;
if (!tracker_spawn_async_with_channels (argv,
- 10,
+ 0,
&pid,
&stdin_channel,
&stdout_channel,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]