Skip to content

Commit

Permalink
GH a2o#119: Stop symbol leaks in datasources and filters
Browse files Browse the repository at this point in the history
  • Loading branch information
bostjan committed Nov 25, 2020
1 parent 51ff8aa commit 02ce0b5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/datasource/rpname.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@
/*
* Non-public function prototypes
*/
int get_parent_pid (int pid);
int get_rpname (int pid, char *result);
char* read_proc_property (int pid, char* prop_name);
static int get_parent_pid (int pid);
static int get_rpname (int pid, char *result);
static char* read_proc_property (int pid, char* prop_name);



Expand All @@ -91,7 +91,7 @@ int snoopy_datasource_rpname (char * const result, char const * const arg)


/* Read /proc/{pid}/status file and extract the property */
char* read_proc_property (int pid, char* prop_name)
static char* read_proc_property (int pid, char* prop_name)
{
char pid_file[50];
FILE *fp;
Expand Down Expand Up @@ -179,7 +179,7 @@ char* read_proc_property (int pid, char* prop_name)


/* Get parent pid */
int get_parent_pid (int pid)
static int get_parent_pid (int pid)
{
char *ppid_str;
int ppid_int;
Expand All @@ -197,7 +197,7 @@ int get_parent_pid (int pid)


/* Find root process name */
int get_rpname (int pid, char *result)
static int get_rpname (int pid, char *result)
{
int parentPid;
char *name;
Expand Down
12 changes: 6 additions & 6 deletions src/filter/exclude_spawns_of.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
/*
* Non-public function prototypes
*/
int find_ancestor_in_list(char **name_list);
int find_string_in_array(char *str, char **str_array);
char **string_to_token_array(char *str);
static int find_ancestor_in_list(char **name_list);
static int find_string_in_array(char *str, char **str_array);
static char **string_to_token_array(char *str);



Expand Down Expand Up @@ -107,7 +107,7 @@ int snoopy_filter_exclude_spawns_of(char *msg, char const * const arg)
* 0 if there are no ancestor that have a name found in name_list
* -1 if error.
*/
int find_ancestor_in_list(char **name_list)
static int find_ancestor_in_list(char **name_list)
{
pid_t ppid;
char stat_path[32]; // Path "/proc/nnnn/stat" where nnnn = some PID
Expand Down Expand Up @@ -182,7 +182,7 @@ int find_ancestor_in_list(char **name_list)
* 1 if str matches one of the strings in str_array
* 0 if there are no matches or if either argument is NULL.
*/
int find_string_in_array(char *str, char **str_array)
static int find_string_in_array(char *str, char **str_array)
{
if ((str == NULL) || (str_array == NULL)) {
return 0;
Expand Down Expand Up @@ -210,7 +210,7 @@ int find_string_in_array(char *str, char **str_array)
* If str is NULL or empty, or if error, returns NULL.
*/

char **string_to_token_array(char *str)
static char **string_to_token_array(char *str)
{
char *p;
int i;
Expand Down

0 comments on commit 02ce0b5

Please sign in to comment.