Skip to content

Commit

Permalink
Orgnize includes
Browse files Browse the repository at this point in the history
  • Loading branch information
HiGarfield committed Jan 23, 2025
1 parent 20eca73 commit 081316a
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/cpulimit.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <limits.h>

#include "process_group.h"
#include "list.h"
#include "process_group.h"
#include "process_iterator.h"
#include "util.h"

#ifndef EPSILON
Expand Down
7 changes: 3 additions & 4 deletions src/process_group.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,16 @@
#define _GNU_SOURCE
#endif

#include <signal.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <time.h>

#include "process_iterator.h"
#include "process_group.h"
#include "list.h"
#include "process_iterator.h"
#include "process_table.h"
#include "util.h"

Expand Down
3 changes: 1 addition & 2 deletions src/process_group.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@
#define _GNU_SOURCE
#endif

#include <time.h>
#include <sys/types.h>
#include <time.h>
#include "list.h"
#include "process_iterator.h"
#include "process_table.h"

/**
Expand Down
6 changes: 3 additions & 3 deletions src/process_iterator_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
#define _GNU_SOURCE
#endif

#include <ctype.h>
#include <dirent.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <dirent.h>
#include <sys/stat.h>
#include <sys/vfs.h>
#include <sys/types.h>
#include <time.h>
#include <unistd.h>

Expand Down
1 change: 0 additions & 1 deletion src/process_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#endif

#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <stdio.h>
#include "process_table.h"
Expand Down
10 changes: 8 additions & 2 deletions src/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,25 @@
#define _GNU_SOURCE
#endif

#include <sys/resource.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <sys/resource.h>
#include <unistd.h>
#if defined(__linux__) && defined(__UCLIBC__)
#include <stdlib.h>
#include <errno.h>
#endif
#if defined(__APPLE__) || defined(__FreeBSD__)
#include <sys/types.h>
#include <sys/sysctl.h>
#endif
#ifdef HAVE_SYS_SYSINFO_H
#include <sys/sysinfo.h>
#endif
#ifdef __IMPL_GET_TIME
#include <sys/time.h>
#endif

#include "util.h"

#ifdef __IMPL_BASENAME
Expand Down
1 change: 0 additions & 1 deletion src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#endif

#include <time.h>
#include <sys/time.h>
#include <sys/types.h>
#include <string.h>
#include <unistd.h>
Expand Down
1 change: 1 addition & 0 deletions tests/process_iterator_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "../src/process_iterator.h"
#include "../src/process_group.h"
#include "../src/util.h"
#include "../src/list.h"

#ifndef __GNUC__
#define __attribute__(attr)
Expand Down

0 comments on commit 081316a

Please sign in to comment.