guint64 readytime = g_source_get_ready_time (self->timer_event);
guint64 curtime = g_source_get_time (self->timer_event);
guint64 timeout_micros = curtime - readytime;
- if (timeout_micros < 0)
+ if (curtime < readytime)
timeout_micros = 0;
update_timeout_cb (self->multi, timeout_micros / 1000, self);
}
initiate_next_curl_request (FetcherRequest *req,
GTask *task)
{
- CURLMcode rc;
+ CURLcode rc;
OstreeFetcher *self = req->fetcher;
if (req->easy)
curl_easy_setopt (req->easy, CURLOPT_WRITEDATA, task);
curl_easy_setopt (req->easy, CURLOPT_PROGRESSDATA, task);
- rc = curl_multi_add_handle (self->multi, req->easy);
- g_assert (rc == CURLM_OK);
+ CURLMcode multi_rc = curl_multi_add_handle (self->multi, req->easy);
+ g_assert (multi_rc == CURLM_OK);
}
static void
while (!ret_tmpdir.initialized)
{
struct dirent *dent;
- glnx_fd_close int existing_tmpdir_fd = -1;
g_autoptr(GError) local_error = NULL;
if (!glnx_dirfd_iterator_next_dent (&dfd_iter, &dent, cancellable, error))
if (!command->fn)
{
- g_autoptr(GOptionContext) context = NULL;
- g_autofree char *help = NULL;
-
- context = ostree_option_context_new_with_commands (commands);
+ g_autoptr(GOptionContext) context =
+ ostree_option_context_new_with_commands (commands);
/* This will not return for some options (e.g. --version). */
if (ostree_option_context_parse (context, NULL, &argc, &argv, OSTREE_BUILTIN_FLAG_NO_REPO, NULL, cancellable, &error))