aboutsummaryrefslogtreecommitdiffstats
path: root/src/mds-registry
diff options
context:
space:
mode:
Diffstat (limited to 'src/mds-registry')
-rw-r--r--src/mds-registry/mds-registry.c4
-rw-r--r--src/mds-registry/registry.c10
2 files changed, 6 insertions, 8 deletions
diff --git a/src/mds-registry/mds-registry.c b/src/mds-registry/mds-registry.c
index 741423c..8b2a3e5 100644
--- a/src/mds-registry/mds-registry.c
+++ b/src/mds-registry/mds-registry.c
@@ -175,8 +175,8 @@ int master_loop(void)
}
else if (errno == EINTR)
continue;
- else if (errno != ECONNRESET)
- goto pfail;
+ else
+ fail_if (errno != ECONNRESET);
eprint("lost connection to server.");
mds_message_destroy(&received);
diff --git a/src/mds-registry/registry.c b/src/mds-registry/registry.c
index 2d0643f..89f1d80 100644
--- a/src/mds-registry/registry.c
+++ b/src/mds-registry/registry.c
@@ -132,8 +132,7 @@ static int registry_action_add(int has_key, char* command, size_t command_key, u
/* Add server to protocol if the protocol is already in the table. */
size_t address = hash_table_get(&reg_table, command_key);
client_list_t* list = (client_list_t*)(void*)address;
- if (client_list_add(list, client) < 0)
- goto pfail;
+ fail_if (client_list_add(list, client) < 0);
}
else
{
@@ -142,13 +141,12 @@ static int registry_action_add(int has_key, char* command, size_t command_key, u
/* Allocate list of servers for the protocol. */
client_list_t* list = malloc(sizeof(client_list_t));
void* address = list;
- if (list == NULL)
- goto pfail;
+ fail_if (list == NULL);
/* Duplicate the protocol name so it can be accessed later. */
if ((command = strdup(command)) == NULL)
{
free(list);
- goto pfail;
+ fail_if (1);
}
/* Create list of servers, add server to list and add the protocol to the table. */
command_key = (size_t)(void*)command;
@@ -159,7 +157,7 @@ static int registry_action_add(int has_key, char* command, size_t command_key, u
client_list_destroy(list);
free(list);
free(command);
- goto pfail;
+ fail_if (1);
}
}