shared: missing includes from IWYU

This commit is contained in:
Sam James 2023-01-29 04:15:48 +00:00 committed by William Hubbs
parent 17cfb41d81
commit 616f756ca8
9 changed files with 22 additions and 26 deletions

View File

@ -13,10 +13,12 @@
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "rc.h"
#include "misc.h"
#include "_usage.h"
#include "version.h"
#include "helpers.h"
void set_quiet_options(void)

View File

@ -11,6 +11,7 @@
*/
#include <getopt.h>
#include <stdlib.h>
#define getoptstring_COMMON "ChqVv"

View File

@ -18,9 +18,13 @@
#ifndef __HELPERS_H__
#define __HELPERS_H__
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#define ERRX fprintf (stderr, "out of memory\n"); exit (1)
@ -61,10 +65,6 @@
} while (/* CONSTCOND */ 0)
#endif
#include <stdarg.h>
#include <stdbool.h>
#include <sys/stat.h>
_unused static void *xmalloc (size_t size)
{
void *value = malloc(size);
@ -135,7 +135,7 @@ _unused static bool existss(const char *pathname)
/*
* This is an OpenRC specific version of the asprintf() function.
* We do this to avoid defining the _GNU_SOURCE feature test macro on
* glibc systems and to insure that we have a consistent function across
* glibc systems and to ensure that we have a consistent function across
* platforms. This also allows us to call our xmalloc and xrealloc
* functions to handle memory allocation.
* this function was originally written by Mike Frysinger.

View File

@ -15,22 +15,21 @@
* except according to the terms contained in the LICENSE file.
*/
#include <sys/file.h>
#include <sys/types.h>
#include <sys/utsname.h>
#ifdef __linux__
# include <sys/sysinfo.h>
#endif
#include <sys/time.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/file.h>
#include <sys/time.h>
#ifdef __linux__
# include <sys/sysinfo.h>
#endif
#include <sys/types.h>
#include <sys/utsname.h>
#include <time.h>
#include <unistd.h>
#include <utime.h>
@ -40,6 +39,7 @@
#include "rc.h"
#include "misc.h"
#include "version.h"
#include "helpers.h"
extern char **environ;

View File

@ -19,6 +19,7 @@
#define __RC_MISC_H__
#include <sys/stat.h>
#include <sys/types.h>
#include <errno.h>
#include <stdbool.h>
#include <stdlib.h>

View File

@ -17,12 +17,10 @@
#include <sys/types.h>
#include <sys/wait.h>
#include <dirent.h>
#include <dlfcn.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
@ -32,8 +30,8 @@
#include "einfo.h"
#include "queue.h"
#include "rc.h"
#include "misc.h"
#include "plugin.h"
#include "helpers.h"
#define RC_PLUGIN_HOOK "rc_plugin_hook"

View File

@ -30,16 +30,11 @@
#include <string.h>
#include <syslog.h>
#include <time.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/wait.h>
#include "einfo.h"
#include "queue.h"
#include "rc.h"
#include "misc.h"
#include "schedules.h"
#include "helpers.h"

View File

@ -15,14 +15,12 @@
* except according to the terms contained in the LICENSE file.
*/
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/utsname.h>
#include <utmp.h>
#include "wtmp.h"

View File

@ -19,6 +19,7 @@
#define __RC_WTMP_H__
#include <utmp.h>
#include <sys/types.h>
void log_wtmp(const char *user, const char *id, pid_t pid, int type,
const char *line);