Some bits here and there...

This commit is contained in:
2016-08-10 01:08:56 +03:00
parent 0c4a57faed
commit 65b923cba8
7 changed files with 26 additions and 16 deletions

View File

@@ -27,6 +27,10 @@ $(EXECUTABLE): $(OBJECTS)
@echo ' CC $@'
@$(CC) $(CCFLAGS) -c $< -o $@
debug: CCFLAGS = -O0 -g -Q
debug: $(SOURCES) $(EXECUTABLE)
@echo ' Compiling debug with $(CCFLAGS)'
clean:
rm -rf $(OBJECTS) $(EXECUTABLE)

View File

@@ -201,3 +201,4 @@ int main(int count, char *strings[])
close(server); /* close socket */
SSL_CTX_free(ctx); /* release context */
}

View File

@@ -5,6 +5,7 @@
#include "job.h"
#include <sys/utsname.h>
#include <sys/sysinfo.h>
#include <pthread.h>
struct job_t {
long id;
@@ -144,9 +145,11 @@ void* get_memory(void *args)
freepages = sysconf(_SC_AVPHYS_PAGES);
job->buf.meta.len = sprintf( (char*)job->buf.chunk.data,
"%ld / %ld (MB)",
(freepages * pagesize) / 1048576 /* 1024*1024 */,
(pages * pagesize) / 1048576 );
((pages - freepages) * pagesize) / 1048576 /* 1024*1024 */,
(pages * pagesize) / 1048576 );
SSL_write(job->ssl, &job->buf, sizeof(struct msg));
job->slot = FREE;
return 0;
//return 0;
pthread_detach(pthread_self());
pthread_exit(NULL);
}