mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:17:36 +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,6 +1,6 @@
|
|||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static volatile bool got_alarm = false;
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <AK/AKString.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <AK/AKString.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
|
|
|
@ -6,4 +6,3 @@ int main(int, char**)
|
|||
fflush(stdout);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <AK/AKString.h>
|
||||
#include <AK/FileSystemPath.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <assert.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/stat.h>
|
||||
#include <AK/AKString.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <AK/FileSystemPath.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
|
|
|
@ -10,7 +10,13 @@ static void print_usage_and_exit()
|
|||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
enum Mode { SegmentationViolation, DivisionByZero, IllegalInstruction, Abort };
|
||||
enum Mode
|
||||
{
|
||||
SegmentationViolation,
|
||||
DivisionByZero,
|
||||
IllegalInstruction,
|
||||
Abort
|
||||
};
|
||||
Mode mode = SegmentationViolation;
|
||||
|
||||
if (argc != 2)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
|
@ -21,4 +21,3 @@ int main(int argc, char** argv)
|
|||
tm->tm_sec);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include <AK/AKString.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
struct FileSystem {
|
||||
String fs;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#include <LibCore/CFile.h>
|
||||
#include <assert.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <assert.h>
|
||||
#include <LibCore/CFile.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
|
|
|
@ -1,24 +1,24 @@
|
|||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <assert.h>
|
||||
#include <time.h>
|
||||
#include <Kernel/Syscall.h>
|
||||
#include <SharedGraphics/GraphicsBitmap.h>
|
||||
#include <LibGUI/GPainter.h>
|
||||
#include <LibGUI/GWindow.h>
|
||||
#include <LibGUI/GWidget.h>
|
||||
#include <LibGUI/GLabel.h>
|
||||
#include <LibGUI/GButton.h>
|
||||
#include <LibGUI/GTextBox.h>
|
||||
#include <LibGUI/GBoxLayout.h>
|
||||
#include <LibGUI/GCheckBox.h>
|
||||
#include <LibGUI/GProgressBar.h>
|
||||
#include <LibGUI/GApplication.h>
|
||||
#include <LibGUI/GBoxLayout.h>
|
||||
#include <LibGUI/GButton.h>
|
||||
#include <LibGUI/GCheckBox.h>
|
||||
#include <LibGUI/GLabel.h>
|
||||
#include <LibGUI/GPainter.h>
|
||||
#include <LibGUI/GProgressBar.h>
|
||||
#include <LibGUI/GTextBox.h>
|
||||
#include <LibGUI/GWidget.h>
|
||||
#include <LibGUI/GWindow.h>
|
||||
#include <SharedGraphics/GraphicsBitmap.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static GWindow* make_launcher_window();
|
||||
static GWindow* make_progress_window();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include <LibCore/CArgsParser.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <LibCore/CArgsParser.h>
|
||||
|
||||
int head(const String& filename, bool print_filename, int line_count);
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#include <netdb.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#include <netinet/in.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
|
@ -16,4 +16,3 @@ int main(int argc, char** argv)
|
|||
printf("%s\n", buffer);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <pwd.h>
|
||||
#include <grp.h>
|
||||
#include <alloca.h>
|
||||
#include <grp.h>
|
||||
#include <pwd.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
extern "C" int main(int, char**);
|
||||
|
||||
|
@ -40,4 +40,3 @@ int main(int argc, char** argv)
|
|||
printf("\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
#include <AK/AKString.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static void print_usage_and_exit()
|
||||
{
|
||||
|
@ -38,4 +38,3 @@ int main(int argc, char** argv)
|
|||
perror("kill");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -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()
|
||||
{
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <LibCore/CArgsParser.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
|
@ -35,4 +35,3 @@ int main(int argc, char** argv)
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <getopt.h>
|
||||
#include <time.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <AK/AKString.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibCore/CDirIterator.h>
|
||||
#include <pwd.h>
|
||||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <getopt.h>
|
||||
#include <grp.h>
|
||||
#include <pwd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static int do_file_system_object_long(const char* path);
|
||||
static int do_file_system_object_short(const char* path);
|
||||
|
@ -119,7 +119,8 @@ int print_name(struct stat& st, const char* name, const char* path_for_link_reso
|
|||
return nprinted;
|
||||
}
|
||||
|
||||
bool print_filesystem_object(const char* path, const char* name) {
|
||||
bool print_filesystem_object(const char* path, const char* name)
|
||||
{
|
||||
struct stat st;
|
||||
int rc = lstat(path, &st);
|
||||
if (rc == -1) {
|
||||
|
@ -155,8 +156,7 @@ bool print_filesystem_object(const char* path, const char* name) {
|
|||
st.st_mode & S_IWGRP ? 'w' : '-',
|
||||
st.st_mode & S_ISGID ? 's' : (st.st_mode & S_IXGRP ? 'x' : '-'),
|
||||
st.st_mode & S_IROTH ? 'r' : '-',
|
||||
st.st_mode & S_IWOTH ? 'w' : '-'
|
||||
);
|
||||
st.st_mode & S_IWOTH ? 'w' : '-');
|
||||
|
||||
if (st.st_mode & S_ISVTX)
|
||||
printf("t");
|
||||
|
@ -221,8 +221,8 @@ int do_file_system_object_long(const char* path)
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
bool print_filesystem_object_short(const char *path, const char *name, int *nprinted) {
|
||||
bool print_filesystem_object_short(const char* path, const char* name, int* nprinted)
|
||||
{
|
||||
struct stat st;
|
||||
int rc = lstat(path, &st);
|
||||
if (rc == -1) {
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
inline constexpr unsigned encoded_device(unsigned major, unsigned minor)
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include <LibCore/CFile.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <LibCore/CFile.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static int key_fd;
|
||||
|
||||
|
@ -39,7 +39,6 @@ int main(int argc, char** argv)
|
|||
if ((lines_printed % (ws.ws_row - 1)) == 0) {
|
||||
wait_for_key();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
close(key_fd);
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <AK/AKString.h>
|
||||
#include <AK/FileSystemPath.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <dirent.h>
|
||||
#include <AK/AKString.h>
|
||||
#include <AK/FileSystemPath.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <AK/FileSystemPath.h>
|
||||
#include <LibCore/CArgsParser.h>
|
||||
#include <LibCore/CDirIterator.h>
|
||||
#include <LibGUI/GDesktop.h>
|
||||
#include <LibGUI/GApplication.h>
|
||||
#include <LibGUI/GDesktop.h>
|
||||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static int handle_show_all()
|
||||
{
|
||||
|
@ -73,4 +73,3 @@ int main(int argc, char** argv)
|
|||
|
||||
return handle_set_pape(values[0]);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
#include <LibCore/CProcessStatisticsReader.h>
|
||||
#include <LibCore/CArgsParser.h>
|
||||
#include <AK/AKString.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <AK/HashMap.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibCore/CArgsParser.h>
|
||||
#include <LibCore/CProcessStatisticsReader.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static int pid_of(const String& process_name, bool single_shot, bool omit_pid, pid_t pid)
|
||||
{
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
#include <sys/socket.h>
|
||||
#include <sys/time.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netinet/ip_icmp.h>
|
||||
#include <netdb.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/ip_icmp.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <netdb.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
uint16_t internet_checksum(const void* ptr, size_t count)
|
||||
{
|
||||
|
@ -47,7 +47,9 @@ int main(int argc, char** argv)
|
|||
return 1;
|
||||
}
|
||||
|
||||
struct timeval timeout { 1, 0 };
|
||||
struct timeval timeout {
|
||||
1, 0
|
||||
};
|
||||
int rc = setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout));
|
||||
if (rc < 0) {
|
||||
perror("setsockopt");
|
||||
|
@ -131,8 +133,7 @@ int main(int argc, char** argv)
|
|||
ntohs(pong_packet.header.un.echo.id),
|
||||
ntohs(pong_packet.header.un.echo.sequence),
|
||||
pong_packet.header.un.echo.sequence != ping_packet.header.un.echo.sequence ? "(!)" : "",
|
||||
ms
|
||||
);
|
||||
ms);
|
||||
|
||||
// If this was a response to an earlier packet, we still need to wait for the current one.
|
||||
if (pong_packet.header.un.echo.sequence != ping_packet.header.un.echo.sequence)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include <LibCore/CFile.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <LibCore/CFile.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#include <SharedGraphics/PNGLoader.h>
|
||||
#include <LibGUI/GApplication.h>
|
||||
#include <LibGUI/GWindow.h>
|
||||
#include <LibGUI/GLabel.h>
|
||||
#include <LibGUI/GBoxLayout.h>
|
||||
#include <LibGUI/GMenuBar.h>
|
||||
#include <LibGUI/GMenu.h>
|
||||
#include <LibGUI/GAction.h>
|
||||
#include <LibGUI/GApplication.h>
|
||||
#include <LibGUI/GBoxLayout.h>
|
||||
#include <LibGUI/GLabel.h>
|
||||
#include <LibGUI/GMenu.h>
|
||||
#include <LibGUI/GMenuBar.h>
|
||||
#include <LibGUI/GWindow.h>
|
||||
#include <SharedGraphics/PNGLoader.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
|
@ -15,4 +15,3 @@ int main(int argc, char** argv)
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
#include <AK/AKString.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
void handle_sigint(int)
|
||||
{
|
||||
|
@ -29,4 +29,3 @@ int main(int argc, char** argv)
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include <AK/AKString.h>
|
||||
#include <AK/QuickSort.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <AK/AKString.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
#include <pwd.h>
|
||||
#include <grp.h>
|
||||
#include <pwd.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/stat.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
|
@ -62,8 +62,7 @@ int main(int argc, char** argv)
|
|||
st.st_mode & S_IWGRP ? 'w' : '-',
|
||||
st.st_mode & S_ISGID ? 's' : (st.st_mode & S_IXGRP ? 'x' : '-'),
|
||||
st.st_mode & S_IROTH ? 'r' : '-',
|
||||
st.st_mode & S_IWOTH ? 'w' : '-'
|
||||
);
|
||||
st.st_mode & S_IWOTH ? 'w' : '-');
|
||||
|
||||
if (st.st_mode & S_ISVTX)
|
||||
printf("t");
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#include <AK/Assertions.h>
|
||||
#include <AK/Types.h>
|
||||
#include <Kernel/Syscall.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static int usage()
|
||||
{
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <pwd.h>
|
||||
#include <grp.h>
|
||||
#include <alloca.h>
|
||||
#include <grp.h>
|
||||
#include <pwd.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
extern "C" int main(int, char**);
|
||||
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <AK/AKString.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibCore/CArgsParser.h>
|
||||
#include <LibCore/CDirIterator.h>
|
||||
#include <LibCore/CFile.h>
|
||||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static String read_var(const String& name)
|
||||
{
|
||||
|
@ -48,7 +48,6 @@ static void write_var(const String& name, const String& value)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
static int handle_show_all()
|
||||
{
|
||||
CDirIterator di("/proc/sys", CDirIterator::SkipDots);
|
||||
|
@ -102,4 +101,3 @@ int main(int argc, char** argv)
|
|||
Vector<String> values = args.get_single_values();
|
||||
return handle_var(values[0]);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <AK/Assertions.h>
|
||||
#include <LibCore/CFile.h>
|
||||
#include <LibCore/CArgsParser.h>
|
||||
#include <LibCore/CFile.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define DEFAULT_LINE_COUNT 10
|
||||
|
||||
|
|
|
@ -20,7 +20,9 @@ int main(int argc, char** argv)
|
|||
return 1;
|
||||
}
|
||||
|
||||
struct timeval timeout { 3, 0 };
|
||||
struct timeval timeout {
|
||||
3, 0
|
||||
};
|
||||
int rc = setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout));
|
||||
if (rc < 0) {
|
||||
perror("setsockopt");
|
||||
|
|
|
@ -120,4 +120,3 @@ int main(int argc, char** argv)
|
|||
|
||||
return (err_open || err_write) ? 1 : 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <AK/AKString.h>
|
||||
#include <AK/HashMap.h>
|
||||
#include <AK/QuickSort.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <fcntl.h>
|
||||
#include <pwd.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <AK/HashMap.h>
|
||||
#include <AK/AKString.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <AK/QuickSort.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static HashMap<unsigned, String>* s_usernames;
|
||||
|
||||
|
@ -113,7 +113,6 @@ int main(int, char**)
|
|||
processes.append(&it.value);
|
||||
}
|
||||
|
||||
|
||||
quick_sort(processes.begin(), processes.end(), [](auto* p1, auto* p2) {
|
||||
return p2->nsched_since_prev < p1->nsched_since_prev;
|
||||
});
|
||||
|
@ -128,8 +127,7 @@ int main(int, char**)
|
|||
process->committed / 1024,
|
||||
process->cpu_percent,
|
||||
process->cpu_percent_decimal,
|
||||
process->name.characters()
|
||||
);
|
||||
process->name.characters());
|
||||
}
|
||||
processes.clear_with_capacity();
|
||||
prev = move(current);
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <utime.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <utime.h>
|
||||
|
||||
static bool file_exists(const char* path)
|
||||
{
|
||||
|
@ -46,4 +46,3 @@ int main(int argc, char** argv)
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include <AK/AKString.h>
|
||||
#include <AK/QuickSort.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <AK/AKString.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
|
|
|
@ -20,7 +20,9 @@ int main(int argc, char** argv)
|
|||
return 1;
|
||||
}
|
||||
|
||||
struct timeval timeout { 5, 0 };
|
||||
struct timeval timeout {
|
||||
5, 0
|
||||
};
|
||||
int rc = setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout));
|
||||
if (rc < 0) {
|
||||
perror("setsockopt");
|
||||
|
|
|
@ -20,11 +20,21 @@ int main(int argc, char** argv)
|
|||
if (argv[i][0] == '-') {
|
||||
for (const char* o = &argv[i][1]; *o; ++o) {
|
||||
switch (*o) {
|
||||
case 's': flag_s = true; break;
|
||||
case 'n': flag_n = true; break;
|
||||
case 'r': flag_r = true; break;
|
||||
case 'm': flag_m = true; break;
|
||||
case 'a': flag_s = flag_n = flag_r = flag_m = true; break;
|
||||
case 's':
|
||||
flag_s = true;
|
||||
break;
|
||||
case 'n':
|
||||
flag_n = true;
|
||||
break;
|
||||
case 'r':
|
||||
flag_r = true;
|
||||
break;
|
||||
case 'm':
|
||||
flag_m = true;
|
||||
break;
|
||||
case 'a':
|
||||
flag_s = flag_n = flag_r = flag_m = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -43,4 +53,3 @@ int main(int argc, char** argv)
|
|||
printf("\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue