return 0; /* ignore -- parse failed */
((struct anon_pidfd_data *)unkn->anon_data)->pid = (pid_t)pid;
return 1;
- }
- else if (strcmp(key, "NSpid") == 0) {
+ } else if (strcmp(key, "NSpid") == 0) {
((struct anon_pidfd_data *)unkn->anon_data)->nspid = xstrdup(value);
return 1;
static bool anon_eventfd_probe(const char *str)
{
- return (strncmp(str, "[eventfd]", 9) == 0);
+ return strncmp(str, "[eventfd]", 9) == 0;
}
static char *anon_eventfd_get_name(struct unkn *unkn)
int *tfds;
};
-
static bool anon_eventpoll_probe(const char *str)
{
return strncmp(str, "[eventpoll]", 11) == 0;
static void anon_eventpoll_free(struct unkn *unkn)
{
struct anon_eventpoll_data *data = unkn->anon_data;
- free (data->tfds);
- free (data);
+ free(data->tfds);
+ free(data);
}
static int anon_eventpoll_handle_fdinfo(struct unkn *unkn, const char *key, const char *value)
return 0; /* ignore -- parse failed */
data = (struct anon_eventpoll_data *)unkn->anon_data;
- data->tfds = xreallocarray (data->tfds, ++data->count, sizeof(int));
+ data->tfds = xreallocarray(data->tfds, ++data->count, sizeof(int));
data->tfds[data->count - 1] = (int)tfd;
return 1;
}
return 0;
}
-static int intcmp (const void *a, const void *b)
+static int intcmp(const void *a, const void *b)
{
int ai = *(int *)a;
int bi = *(int *)b;
static void anon_eventpoll_attach_xinfo(struct unkn *unkn)
{
struct anon_eventpoll_data *data = (struct anon_eventpoll_data *)unkn->anon_data;
- qsort (data->tfds, data->count, sizeof (data->tfds[0]),
- intcmp);
+ qsort(data->tfds, data->count, sizeof(data->tfds[0]),
+ intcmp);
}
static char *anon_eventpoll_make_tfds_string(struct anon_eventpoll_data *data,
static char *anon_eventpoll_get_name(struct unkn *unkn)
{
- return anon_eventpoll_make_tfds_string ((struct anon_eventpoll_data *)unkn->anon_data,
- "tfds=");
+ return anon_eventpoll_make_tfds_string((struct anon_eventpoll_data *)unkn->anon_data,
+ "tfds=");
}
static bool anon_eventpoll_fill_column(struct proc *proc __attribute__((__unused__)),
switch(column_id) {
case COL_EVENTPOLL_TFDS:
- *str =anon_eventpoll_make_tfds_string (data, NULL);
+ *str =anon_eventpoll_make_tfds_string(data, NULL);
if (*str)
return true;
break;