Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/lavabit/magma.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLadar Levison <ladar@lavabit.com>2018-09-18 19:37:02 +0300
committerLadar Levison <ladar@lavabit.com>2018-09-18 19:37:02 +0300
commit3f3915dede4b09316feacf0c7c24c313c1222fe7 (patch)
treed8a9538159fde48daa5157d07458bead4f0eee6d /src
parentbc1bed25c8bb072b4697d55eae1c6b860b83566f (diff)
Tweaks needed to enable compiler optimization.
Diffstat (limited to 'src')
-rw-r--r--src/core/host/tcp.c3
-rw-r--r--src/providers/dime/common/error.c8
-rw-r--r--src/providers/prime/messages/messages.c2
-rw-r--r--src/web/portal/endpoint.c2
4 files changed, 8 insertions, 7 deletions
diff --git a/src/core/host/tcp.c b/src/core/host/tcp.c
index dc8a360f..6aabdd90 100644
--- a/src/core/host/tcp.c
+++ b/src/core/host/tcp.c
@@ -42,6 +42,7 @@ int_t tcp_error(int error) {
int_t tcp_status(int sockd) {
struct stat info;
+ stringer_t *buffer = MANAGEDBUF(64);
int result = 0, holder = 0, error = 0;
errno = 0;
@@ -52,7 +53,7 @@ int_t tcp_status(int sockd) {
// In theory the PEEK flag will prevent this call from altering the socket buffer state, while the NOSIGNAL flag
// should cause it to return EPIPE if the connection is no longer valid.
- else if ((holder = recv(sockd, MANAGEDBUF(64), 64, MSG_PEEK | MSG_DONTWAIT | MSG_NOSIGNAL)) <= 0) {
+ else if ((holder = recv(sockd, st_data_get(buffer), 64, MSG_PEEK | MSG_DONTWAIT | MSG_NOSIGNAL)) <= 0) {
// Duplicate the errno so the log pedantic statement below doesn't accidently overwrite it.
error = errno;
diff --git a/src/providers/dime/common/error.c b/src/providers/dime/common/error.c
index 15e534d2..ede0f156 100644
--- a/src/providers/dime/common/error.c
+++ b/src/providers/dime/common/error.c
@@ -244,11 +244,11 @@ errinfo_t *_push_error_stack_syscall(const char *filename, const char *funcname,
memset(auxmsg, 0, sizeof(auxmsg));
snprintf(auxmsg, sizeof(auxmsg) - 1, "%s: ", errfunc);
ptr = auxmsg + strlen(auxmsg);
-#ifdef STRERROR_R_CHAR_P
+//#ifdef STRERROR_R_CHAR_P
ptr = strerror_r(xerrno, ptr, auxmsg_end - ptr);
-#else
- strerror_r(xerrno, ptr, auxmsg_end - ptr);
-#endif
+//#else
+// strerror_r(xerrno, ptr, auxmsg_end - ptr);
+//#endif
return (_push_error_stack(filename, funcname, lineno, ERR_SYSCALL, xerrno, auxmsg));
}
diff --git a/src/providers/prime/messages/messages.c b/src/providers/prime/messages/messages.c
index ea323d3c..a26e073b 100644
--- a/src/providers/prime/messages/messages.c
+++ b/src/providers/prime/messages/messages.c
@@ -79,7 +79,7 @@ stringer_t * naked_message_get(stringer_t *message, prime_org_signet_t *org, pri
prime_chunk_keks_t *keks = NULL;
prime_signature_tree_t *tree = NULL;
uchr_t *data = NULL, *position = NULL;
- placer_t chunk[6], current = pl_null();
+ placer_t chunk[7], current = pl_null();
prime_ephemeral_chunk_t *ephemeral = NULL;
size_t remaining = 0, processed = 0, consumed = 0;
stringer_t *headers = NULL, *body = NULL, *result = NULL;
diff --git a/src/web/portal/endpoint.c b/src/web/portal/endpoint.c
index acd323e3..2f41bc78 100644
--- a/src/web/portal/endpoint.c
+++ b/src/web/portal/endpoint.c
@@ -773,7 +773,7 @@ void portal_endpoint_folders_rename(connection_t *con) {
json_error_t err;
uint64_t foldernum;
- int_t state, context;
+ int_t context, state = 0;
meta_folder_t *active_m = NULL;
magma_folder_t *active_c = NULL;
chr_t *rename = NULL, *method = NULL;