mirror of
https://github.com/sheumann/hush.git
synced 2024-12-27 16:31:24 +00:00
more use const for interface of libbb/compare_string_array, example usage for e2fsprogs/fsck
This commit is contained in:
parent
4eb2fd6826
commit
61ff4b3973
@ -988,8 +988,7 @@ static int fs_match(struct fs_info *fs, struct fs_type_compile *cmp)
|
|||||||
/* Check if we should ignore this filesystem. */
|
/* Check if we should ignore this filesystem. */
|
||||||
static int ignore(struct fs_info *fs)
|
static int ignore(struct fs_info *fs)
|
||||||
{
|
{
|
||||||
const char * const *ip;
|
int wanted;
|
||||||
int wanted = 0;
|
|
||||||
char *s;
|
char *s;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1007,15 +1006,11 @@ static int ignore(struct fs_info *fs)
|
|||||||
if (!fs_match(fs, &fs_type_compiled)) return 1;
|
if (!fs_match(fs, &fs_type_compiled)) return 1;
|
||||||
|
|
||||||
/* Are we ignoring this type? */
|
/* Are we ignoring this type? */
|
||||||
for(ip = ignored_types; *ip; ip++)
|
if(compare_string_array(ignored_types, fs->type))
|
||||||
if (strcmp(fs->type, *ip) == 0) return 1;
|
return 1;
|
||||||
|
|
||||||
/* Do we really really want to check this fs? */
|
/* Do we really really want to check this fs? */
|
||||||
for(ip = really_wanted; *ip; ip++)
|
wanted = compare_string_array(really_wanted, fs->type);
|
||||||
if (strcmp(fs->type, *ip) == 0) {
|
|
||||||
wanted = 1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* See if the <fsck.fs> program is available. */
|
/* See if the <fsck.fs> program is available. */
|
||||||
s = find_fsck(fs->type);
|
s = find_fsck(fs->type);
|
||||||
|
@ -466,7 +466,7 @@ typedef struct {
|
|||||||
} procps_status_t;
|
} procps_status_t;
|
||||||
|
|
||||||
extern procps_status_t * procps_scan(int save_user_arg0);
|
extern procps_status_t * procps_scan(int save_user_arg0);
|
||||||
extern unsigned short compare_string_array(const char *string_array[], const char *key);
|
extern unsigned short compare_string_array(const char * const string_array[], const char *key);
|
||||||
|
|
||||||
extern int my_query_module(const char *name, int which, void **buf, size_t *bufsize, size_t *ret);
|
extern int my_query_module(const char *name, int which, void **buf, size_t *bufsize, size_t *ret);
|
||||||
|
|
||||||
|
@ -17,7 +17,8 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
/* returns the array number of the string */
|
/* returns the array number of the string */
|
||||||
extern unsigned short compare_string_array(const char *string_array[], const char *key)
|
extern unsigned short
|
||||||
|
compare_string_array(const char * const string_array[], const char *key)
|
||||||
{
|
{
|
||||||
unsigned short i;
|
unsigned short i;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user