From: Matthew Leeds Date: Fri, 28 Sep 2018 01:07:51 +0000 (-0700) Subject: lib/repo: Allow disabling lock timeout X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~4^2~19^2~29 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=0c8a6d64edcbc137d870f2e36ad40d2a8023c857;p=ostree.git lib/repo: Allow disabling lock timeout Currently the locking code checks if the value -1 was set for the config key "lock-timeout-secs" and if so, a thread trying to acquire a lock will block indefinitely. Positive values specify how long to attempt to acquire a lock in a non-blocking way (the attempt is made once every second). But when the value is read from the config file, g_ascii_strtoull() is used, which converts it to an unsigned integer. This commit makes libostree use g_ascii_strtoll() instead, so that it's possible to set that key to -1 as intended. Closes: #1737 Approved by: jlebon --- diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c index 5c8f0b6f..19f715aa 100644 --- a/src/libostree/ostree-repo.c +++ b/src/libostree/ostree-repo.c @@ -2832,7 +2832,7 @@ reload_core_config (OstreeRepo *self, &lock_timeout_seconds, error)) return FALSE; - self->lock_timeout_seconds = g_ascii_strtoull (lock_timeout_seconds, NULL, 10); + self->lock_timeout_seconds = g_ascii_strtoll (lock_timeout_seconds, NULL, 10); } }