mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:47:36 +00:00
Applications: Use spawn_or_show_error() for common spawn pattern
This commit is contained in:
parent
5e5a055455
commit
5fd5a03d1f
6 changed files with 18 additions and 44 deletions
|
@ -15,6 +15,7 @@
|
|||
#include <LibGUI/Layout.h>
|
||||
#include <LibGUI/Margins.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGUI/Process.h>
|
||||
#include <LibGfx/Palette.h>
|
||||
#include <LibTimeZone/TimeZone.h>
|
||||
#include <LibUnicode/DateTimeFormat.h>
|
||||
|
@ -156,13 +157,7 @@ Optional<Gfx::FloatPoint> TimeZoneSettingsWidget::compute_time_zone_location() c
|
|||
return Gfx::FloatPoint { mercadian_x, mercadian_y };
|
||||
}
|
||||
|
||||
void TimeZoneSettingsWidget::set_time_zone() const
|
||||
void TimeZoneSettingsWidget::set_time_zone()
|
||||
{
|
||||
pid_t child_pid = 0;
|
||||
char const* argv[] = { "/bin/timezone", m_time_zone.characters(), nullptr };
|
||||
|
||||
if ((errno = posix_spawn(&child_pid, "/bin/timezone", nullptr, nullptr, const_cast<char**>(argv), environ))) {
|
||||
perror("posix_spawn");
|
||||
exit(1);
|
||||
}
|
||||
GUI::Process::spawn_or_show_error(window(), "/bin/timezone", Array { m_time_zone.characters() });
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue