summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Staessens <[email protected]>2021-04-05 11:05:59 +0200
committerSander Vrijders <[email protected]>2021-04-13 19:26:03 +0200
commitc43dfe6ef88910eeff96c76a424e74a554d11c55 (patch)
tree2df82de8e41c27afaf17c463f6b18961f97ccb8e
parent809e4d1957daa701a3390b0526b125cc263bfe26 (diff)
downloadouroboros-c43dfe6ef88910eeff96c76a424e74a554d11c55.tar.gz
ouroboros-c43dfe6ef88910eeff96c76a424e74a554d11c55.zip
irmd: Remove unused variable in prog_table
This removes a program name variable that was not used anymore. Signed-off-by: Dimitri Staessens <[email protected]> Signed-off-by: Sander Vrijders <[email protected]>
-rw-r--r--src/irmd/main.c12
-rw-r--r--src/irmd/prog_table.c25
-rw-r--r--src/irmd/prog_table.h7
3 files changed, 3 insertions, 41 deletions
diff --git a/src/irmd/main.c b/src/irmd/main.c
index 66bad7da..31f244d9 100644
--- a/src/irmd/main.c
+++ b/src/irmd/main.c
@@ -699,7 +699,6 @@ static int bind_program(char * prog,
char ** argv)
{
char * progs;
- char * progn;
char ** argv_dup = NULL;
int i;
char * name_dup = NULL;
@@ -719,13 +718,6 @@ static int bind_program(char * prog,
return -ENOMEM;
}
- progn = strdup(name);
- if (progn == NULL) {
- pthread_rwlock_unlock(&irmd.reg_lock);
- free(progs);
- return -ENOMEM;
- }
-
if ((flags & BIND_AUTO) && argc) {
/* We need to duplicate argv and set argv[0] to prog. */
argv_dup = malloc((argc + 2) * sizeof(*argv_dup));
@@ -739,17 +731,15 @@ static int bind_program(char * prog,
"%s to %s.",
prog, name);
free(progs);
- free(progn);
return -ENOMEM;
}
}
argv_dup[argc + 1] = NULL;
}
- e = prog_entry_create(progn, progs, flags, argv_dup);
+ e = prog_entry_create(progs, flags, argv_dup);
if (e == NULL) {
pthread_rwlock_unlock(&irmd.reg_lock);
free(progs);
- free(progn);
argvfree(argv_dup);
return -ENOMEM;
}
diff --git a/src/irmd/prog_table.c b/src/irmd/prog_table.c
index a6cc37ab..eb2b1966 100644
--- a/src/irmd/prog_table.c
+++ b/src/irmd/prog_table.c
@@ -30,14 +30,12 @@
#include <stdlib.h>
#include <string.h>
-struct prog_entry * prog_entry_create(char * progn,
- char * prog,
+struct prog_entry * prog_entry_create(char * prog,
uint32_t flags,
char ** argv)
{
struct prog_entry * e;
- assert(progn);
assert(prog);
e = malloc(sizeof(*e));
@@ -47,7 +45,6 @@ struct prog_entry * prog_entry_create(char * progn,
list_head_init(&e->next);
list_head_init(&e->names);
- e->progn = progn;
e->prog = prog;
e->flags = flags;
@@ -69,9 +66,6 @@ void prog_entry_destroy(struct prog_entry * e)
if (e == NULL)
return;
- if (e->progn != NULL)
- free(e->progn);
-
if (e->prog != NULL)
free(e->prog);
@@ -168,20 +162,3 @@ struct prog_entry * prog_table_get(struct list_head * prog_table,
return NULL;
}
-
-struct prog_entry * prog_table_get_by_progn(struct list_head * prog_table,
- char * progn)
-{
- struct list_head * p;
-
- assert(prog_table);
- assert(progn);
-
- list_for_each(p, prog_table) {
- struct prog_entry * e = list_entry(p, struct prog_entry, next);
- if (!strcmp(e->progn, progn))
- return e;
- }
-
- return NULL;
-}
diff --git a/src/irmd/prog_table.h b/src/irmd/prog_table.h
index 35fb7784..eed046c8 100644
--- a/src/irmd/prog_table.h
+++ b/src/irmd/prog_table.h
@@ -30,15 +30,13 @@
struct prog_entry {
struct list_head next;
- char * progn; /* name for irmd */
char * prog; /* name of binary */
uint32_t flags;
char ** argv;
struct list_head names; /* names that all instances will listen for */
};
-struct prog_entry * prog_entry_create(char * progn,
- char * prog,
+struct prog_entry * prog_entry_create(char * prog,
uint32_t flags,
char ** argv);
@@ -59,7 +57,4 @@ void prog_table_del(struct list_head * prog_table,
struct prog_entry * prog_table_get(struct list_head * prog_table,
char * prog);
-struct prog_entry * prog_table_get_by_progn(struct list_head * prog_table,
- char * progn);
-
#endif /* OUROBOROS_IRMD_PROG_TABLE_H */