mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 02:28:12 +00:00
Userland: Run clang-format on everything.
This commit is contained in:
parent
f7ede145b4
commit
b07bbf383d
48 changed files with 271 additions and 268 deletions
|
@ -1,9 +1,9 @@
|
|||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
#include <LibCore/CProcessStatisticsReader.h>
|
||||
#include <AK/AKString.h>
|
||||
#include <LibCore/CProcessStatisticsReader.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static void print_usage_and_exit()
|
||||
{
|
||||
|
@ -14,15 +14,15 @@ static void print_usage_and_exit()
|
|||
static int kill_all(const String& process_name, const unsigned signum)
|
||||
{
|
||||
HashMap<pid_t, CProcessStatistics> processes = CProcessStatisticsReader().get_map();
|
||||
|
||||
|
||||
for (auto& it : processes) {
|
||||
if (it.value.name == process_name) {
|
||||
if (it.value.name == process_name) {
|
||||
int ret = kill(it.value.pid, signum);
|
||||
if (ret < 0)
|
||||
perror("kill");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -31,16 +31,16 @@ int main(int argc, char** argv)
|
|||
bool ok;
|
||||
unsigned signum = SIGTERM;
|
||||
int name_argi = 1;
|
||||
|
||||
|
||||
if (argc != 2 && argc != 3)
|
||||
print_usage_and_exit();
|
||||
|
||||
|
||||
if (argc == 3) {
|
||||
name_argi = 2;
|
||||
|
||||
|
||||
if (argv[1][0] != '-')
|
||||
print_usage_and_exit();
|
||||
|
||||
|
||||
signum = String(&argv[1][1]).to_uint(ok);
|
||||
if (!ok) {
|
||||
printf("'%s' is not a valid signal number\n", &argv[1][1]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue