N_("user of the process") },
};
-static int default_columns[] = {
+static const int default_columns[] = {
COL_COMMAND,
COL_PID,
COL_USER,
COL_NAME,
};
-static int default_threads_columns[] = {
+static const int default_threads_columns[] = {
COL_COMMAND,
COL_PID,
COL_TID,
int main(int argc, char *argv[])
{
int c;
+ size_t i;
char *outarg = NULL;
struct list_head procs;
}
#define INITIALIZE_COLUMNS(COLUMN_SPEC) \
- for (size_t i = 0; i < ARRAY_SIZE(COLUMN_SPEC); i++) \
+ for (i = 0; i < ARRAY_SIZE(COLUMN_SPEC); i++) \
columns[ncolumns++] = COLUMN_SPEC[i]
if (!ncolumns) {
if (ctl.threads)
return EXIT_FAILURE;
scols_init_debug(0);
- ctl.tb = scols_new_table();
+ ctl.tb = scols_new_table();
if (!ctl.tb)
err(EXIT_FAILURE, _("failed to allocate output table"));
if (ctl.json)
scols_table_set_name(ctl.tb, "lsfd");
- for (size_t i = 0; i < ncolumns; i++) {
+ for (i = 0; i < ncolumns; i++) {
const struct colinfo *col = get_column_info(i);
struct libscols_column *cl;
struct name_manager *new_name_manager(void)
{
struct name_manager *nm = xcalloc(1, sizeof(struct name_manager));
+
nm->cache = new_idcache();
if (!nm->cache)
err(EXIT_FAILURE, _("failed to allocate an idcache"));