aboutsummaryrefslogtreecommitdiffstats
path: root/src/mds-server
diff options
context:
space:
mode:
Diffstat (limited to 'src/mds-server')
-rw-r--r--src/mds-server/mds-server.c3
-rw-r--r--src/mds-server/slavery.c8
2 files changed, 5 insertions, 6 deletions
diff --git a/src/mds-server/mds-server.c b/src/mds-server/mds-server.c
index 499ba96..abfc871 100644
--- a/src/mds-server/mds-server.c
+++ b/src/mds-server/mds-server.c
@@ -403,6 +403,7 @@ void queue_message_multicast(char* message, size_t length, client_t* sender)
uint64_t modify_id;
char modify_id_header[13 + 3 * sizeof(uint64_t)];
void* new_buf;
+ int saved_errno;
/* Count the number of headers. */
for (i = 0; i < n; i++)
@@ -440,7 +441,7 @@ void queue_message_multicast(char* message, size_t length, client_t* sender)
*colon = '\0';
if ((headers[i] = strdup(msg)) == NULL)
{
- free(headers[i]);
+ saved_errno = errno, free(headers[i]), errno = saved_errno;
header_count = i;
fail_if (1);
}
diff --git a/src/mds-server/slavery.c b/src/mds-server/slavery.c
index 283251a..a951f99 100644
--- a/src/mds-server/slavery.c
+++ b/src/mds-server/slavery.c
@@ -101,9 +101,8 @@ int create_slave(pthread_t* thread_slot, int slave_fd)
client_t* initialise_client(int client_fd)
{
ssize_t entry = LINKED_LIST_UNUSED;
- int locked = 0;
client_t* information;
- int errno_;
+ int locked = 0, saved_errno;
size_t tmp;
/* Create information table. */
@@ -132,7 +131,7 @@ client_t* initialise_client(int client_fd)
pfail:
- errno_ = errno;
+ saved_errno = errno;
if (locked)
pthread_mutex_unlock(&slave_mutex);
free(information);
@@ -140,7 +139,6 @@ client_t* initialise_client(int client_fd)
{
with_mutex (slave_mutex, linked_list_remove(&client_list, entry););
}
- errno = errno_;
- return NULL;
+ return saved_errno = errno, NULL;
}