Some bits here and there...
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -201,3 +201,4 @@ int main(int count, char *strings[])
|
||||
close(server); /* close socket */
|
||||
SSL_CTX_free(ctx); /* release context */
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user