main: Move cancellable creation later

We should only be calling into GIO once we've set our preparatory
environment variables etc.  Not fixing anything today that I know
of, just noticed while looking at the code.

Closes: #1763
Approved by: jlebon
This commit is contained in:
Colin Walters 2019-02-22 18:52:55 +00:00 committed by Atomic Bot
parent 13e4976f59
commit a2044f8923

View File

@ -391,7 +391,6 @@ int
main (int argc, main (int argc,
char **argv) char **argv)
{ {
GCancellable *cancellable = g_cancellable_new ();
RpmOstreeCommand *command; RpmOstreeCommand *command;
const char *command_name = NULL; const char *command_name = NULL;
g_autofree char *prgname = NULL; g_autofree char *prgname = NULL;
@ -417,6 +416,8 @@ main (int argc,
setlocale (LC_ALL, ""); setlocale (LC_ALL, "");
GCancellable *cancellable = g_cancellable_new ();
/* /*
* Parse the global options. We rearrange the options as * Parse the global options. We rearrange the options as
* necessary, in order to pass relevant options through * necessary, in order to pass relevant options through