mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
Terminal: Use new format functions.
This commit is contained in:
parent
0dec600a2a
commit
712e348fad
Notes:
sideshowbarker
2024-07-19 02:00:04 +09:00
Author: https://github.com/asynts Commit: https://github.com/SerenityOS/serenity/commit/712e348fad6 Pull-request: https://github.com/SerenityOS/serenity/pull/3704
1 changed files with 5 additions and 6 deletions
|
@ -67,9 +67,8 @@ static void utmp_update(const char* tty, pid_t pid, bool create)
|
|||
}
|
||||
if (utmpupdate_pid)
|
||||
return;
|
||||
char shell_pid_string[64];
|
||||
snprintf(shell_pid_string, sizeof(shell_pid_string), "%d", pid);
|
||||
execl("/bin/utmpupdate", "/bin/utmpupdate", "-f", "Terminal", "-p", shell_pid_string, (create ? "-c" : "-d"), tty, nullptr);
|
||||
const auto shell_pid_string = String::formatted("{}", pid);
|
||||
execl("/bin/utmpupdate", "/bin/utmpupdate", "-f", "Terminal", "-p", shell_pid_string.characters(), (create ? "-c" : "-d"), tty, nullptr);
|
||||
}
|
||||
|
||||
static pid_t run_command(int ptm_fd, String command)
|
||||
|
@ -77,7 +76,7 @@ static pid_t run_command(int ptm_fd, String command)
|
|||
pid_t pid = fork();
|
||||
if (pid < 0) {
|
||||
perror("fork");
|
||||
dbg() << "run_command: could not fork to run '" << command << "'";
|
||||
dbgln("run_command: could not fork to run '{}'", command);
|
||||
return pid;
|
||||
}
|
||||
|
||||
|
@ -317,7 +316,7 @@ int main(int argc, char** argv)
|
|||
}));
|
||||
app_menu.add_separator();
|
||||
app_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
|
||||
dbgprintf("Terminal: Quit menu activated!\n");
|
||||
dbgln("Terminal: Quit menu activated!");
|
||||
GUI::Application::the()->quit();
|
||||
}));
|
||||
|
||||
|
@ -382,7 +381,7 @@ int main(int argc, char** argv)
|
|||
|
||||
config->sync();
|
||||
int result = app->exec();
|
||||
dbg() << "Exiting terminal, updating utmp";
|
||||
dbgln("Exiting terminal, updating utmp");
|
||||
utmp_update(pts_name, 0, false);
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue