Skip to content

Commit

Permalink
Check updater exit status on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-fedin committed Sep 18, 2024
1 parent f05191e commit bfb546c
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Telegram/SourceFiles/platform/linux/launcher_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,19 +116,17 @@ bool Launcher::launchUpdater(UpdaterLaunch action) {
nullptr,
nullptr,
nullptr);
} else if (!GLib::spawn_sync(
} else if (const auto updated = GLib::spawn_sync(
argumentsList,
{},
// if the spawn is sync, working directory is not set
// and GLib::SpawnFlags::LEAVE_DESCRIPTORS_OPEN_ is set,
// it goes through an optimized code path
GLib::SpawnFlags::SEARCH_PATH_
| GLib::SpawnFlags::LEAVE_DESCRIPTORS_OPEN_,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr)) {
nullptr); !updated || !g_spawn_check_exit_status(
std::get<2>(*updated),
nullptr)) {
return false;
}
return launchUpdater(UpdaterLaunch::JustRelaunch);
Expand Down

0 comments on commit bfb546c

Please sign in to comment.