mirror of
https://github.com/SELinuxProject/selinux
synced 2025-05-03 16:17:59 +00:00
Fix gcc -Wstrict-prototypes warnings
In C, defining a function with () means "any number of parameters", not "no parameter". Use (void) instead where applicable and add unused parameters when needed. Acked-by: Steve Lawrence <slawrence@tresys.com>
This commit is contained in:
parent
188a028f74
commit
c4a4a1a7ed
@ -289,7 +289,7 @@ static int identify_equiv_types(void)
|
|||||||
|
|
||||||
extern char *av_to_string(uint32_t tclass, sepol_access_vector_t av);
|
extern char *av_to_string(uint32_t tclass, sepol_access_vector_t av);
|
||||||
|
|
||||||
int display_bools()
|
int display_bools(void)
|
||||||
{
|
{
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
|
|
||||||
@ -335,7 +335,7 @@ void display_expr(cond_expr_t * exp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int display_cond_expressions()
|
int display_cond_expressions(void)
|
||||||
{
|
{
|
||||||
cond_node_t *cur;
|
cond_node_t *cur;
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ extern int yylex(void);
|
|||||||
extern int yywarn(const char *msg);
|
extern int yywarn(const char *msg);
|
||||||
extern int yyerror(const char *msg);
|
extern int yyerror(const char *msg);
|
||||||
|
|
||||||
typedef int (* require_func_t)();
|
typedef int (* require_func_t)(int pass);
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
typedef int (* require_func_t)();
|
typedef int (* require_func_t)(void);
|
||||||
|
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
#include "policy_parse.h"
|
#include "policy_parse.h"
|
||||||
|
@ -807,7 +807,7 @@ static void display_policycaps(policydb_t * p, FILE * fp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int menu()
|
int menu(void)
|
||||||
{
|
{
|
||||||
printf("\nSelect a command:\n");
|
printf("\nSelect a command:\n");
|
||||||
printf("1) display unconditional AVTAB\n");
|
printf("1) display unconditional AVTAB\n");
|
||||||
|
@ -369,7 +369,7 @@ static void display_filename_trans(policydb_t *p, FILE *fp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int menu()
|
int menu(void)
|
||||||
{
|
{
|
||||||
printf("\nSelect a command:\n");
|
printf("\nSelect a command:\n");
|
||||||
printf("1) display unconditional AVTAB\n");
|
printf("1) display unconditional AVTAB\n");
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
extern int semanage_lex(); /* defined in conf-scan.c */
|
extern int semanage_lex(void); /* defined in conf-scan.c */
|
||||||
int semanage_error(const char *msg);
|
int semanage_error(const char *msg);
|
||||||
|
|
||||||
extern FILE *semanage_in;
|
extern FILE *semanage_in;
|
||||||
|
@ -307,7 +307,7 @@ static int process_pam_config(FILE * cfg)
|
|||||||
* Files specified one per line executable with a corresponding
|
* Files specified one per line executable with a corresponding
|
||||||
* pam service name.
|
* pam service name.
|
||||||
*/
|
*/
|
||||||
static int read_pam_config()
|
static int read_pam_config(void)
|
||||||
{
|
{
|
||||||
const char *config_file_path = PAM_SERVICE_CONFIG;
|
const char *config_file_path = PAM_SERVICE_CONFIG;
|
||||||
FILE *cfg = NULL;
|
FILE *cfg = NULL;
|
||||||
@ -966,7 +966,7 @@ static int parse_command_line_arguments(int argc, char **argv, char *ttyn,
|
|||||||
/**
|
/**
|
||||||
* Take care of any signal setup
|
* Take care of any signal setup
|
||||||
*/
|
*/
|
||||||
static int set_signal_handles()
|
static int set_signal_handles(void)
|
||||||
{
|
{
|
||||||
sigset_t empty;
|
sigset_t empty;
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ static int write_pid_file(void)
|
|||||||
/*
|
/*
|
||||||
* SIGTERM handler
|
* SIGTERM handler
|
||||||
*/
|
*/
|
||||||
static void term_handler()
|
static void term_handler(int s __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
terminate = 1;
|
terminate = 1;
|
||||||
/* trigger a failure in the watch */
|
/* trigger a failure in the watch */
|
||||||
|
@ -40,6 +40,6 @@ extern int watch(int fd, const char *watch_file);
|
|||||||
extern void watch_list_add(int inotify_fd, const char *path);
|
extern void watch_list_add(int inotify_fd, const char *path);
|
||||||
extern int watch_list_find(int wd, const char *file);
|
extern int watch_list_find(int wd, const char *file);
|
||||||
extern void watch_list_free(int fd);
|
extern void watch_list_free(int fd);
|
||||||
extern int watch_list_isempty();
|
extern int watch_list_isempty(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -194,7 +194,7 @@ int start() {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int local_server() {
|
static int local_server(void) {
|
||||||
// ! dbus, run as local service
|
// ! dbus, run as local service
|
||||||
char *ptr=NULL;
|
char *ptr=NULL;
|
||||||
if (asprintf(&ptr, "%s/.restorecond", homedir) < 0) {
|
if (asprintf(&ptr, "%s/.restorecond", homedir) < 0) {
|
||||||
|
@ -34,7 +34,7 @@ struct watchList {
|
|||||||
};
|
};
|
||||||
struct watchList *firstDir = NULL;
|
struct watchList *firstDir = NULL;
|
||||||
|
|
||||||
int watch_list_isempty() {
|
int watch_list_isempty(void) {
|
||||||
return firstDir == NULL;
|
return firstDir == NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -230,7 +230,7 @@ int authenticate_via_shadow_passwd(const struct passwd *p_passwd_line)
|
|||||||
* return: 0 When success
|
* return: 0 When success
|
||||||
* -1 When failure
|
* -1 When failure
|
||||||
*/
|
*/
|
||||||
int authenticate_user()
|
int authenticate_user(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
#define INITLEN 255
|
#define INITLEN 255
|
||||||
|
@ -62,7 +62,7 @@ static capng_select_t cap_set = CAPNG_SELECT_CAPS;
|
|||||||
/**
|
/**
|
||||||
* This function will drop all capabilities.
|
* This function will drop all capabilities.
|
||||||
*/
|
*/
|
||||||
static int drop_caps()
|
static int drop_caps(void)
|
||||||
{
|
{
|
||||||
if (capng_have_capabilities(cap_set) == CAPNG_NONE)
|
if (capng_have_capabilities(cap_set) == CAPNG_NONE)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -45,12 +45,12 @@ struct restore_opts {
|
|||||||
};
|
};
|
||||||
|
|
||||||
void restore_init(struct restore_opts *opts);
|
void restore_init(struct restore_opts *opts);
|
||||||
void restore_finish();
|
void restore_finish(void);
|
||||||
int add_exclude(const char *directory);
|
int add_exclude(const char *directory);
|
||||||
int exclude(const char *path);
|
int exclude(const char *path);
|
||||||
void remove_exclude(const char *directory);
|
void remove_exclude(const char *directory);
|
||||||
int process_one_realpath(char *name, int recurse);
|
int process_one_realpath(char *name, int recurse);
|
||||||
int process_glob(char *name, int recurse);
|
int process_glob(char *name, int recurse);
|
||||||
int exclude_non_seclabel_mounts();
|
int exclude_non_seclabel_mounts(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -61,7 +61,7 @@ void usage(const char *const name)
|
|||||||
|
|
||||||
static int nerr = 0;
|
static int nerr = 0;
|
||||||
|
|
||||||
void inc_err()
|
void inc_err(void)
|
||||||
{
|
{
|
||||||
nerr++;
|
nerr++;
|
||||||
if (nerr > ABORT_ON_ERRORS - 1 && !r_opts.debug) {
|
if (nerr > ABORT_ON_ERRORS - 1 && !r_opts.debug) {
|
||||||
|
Loading…
Reference in New Issue
Block a user