src/server/daemon/config.c

changeset 41
bb7a1f5a8b48
parent 39
de4bc3cd2d36
child 44
3da1f7b6847f
--- a/src/server/daemon/config.c	Mon Dec 31 00:07:52 2012 +0100
+++ b/src/server/daemon/config.c	Tue Jan 01 13:32:04 2013 +0100
@@ -38,7 +38,6 @@
 #include <sys/mman.h>
 
 #include "../ucx/string.h"
-#include "../ucx/atomic.h"
 
 #include "httplistener.h"
 #include "config.h"
@@ -52,6 +51,7 @@
 #include "vserver.h"
 #include "../util/pblock.h"
 #include "../util/util.h"
+#include "../util/atomic.h"
 
 pool_handle_t *cfg_pool;
 
@@ -224,11 +224,11 @@
 }
 
 void cfg_ref(ServerConfiguration *cfg) {
-    ucx_atomic_inc_32(&cfg->ref);
+    ws_atomic_inc32(&cfg->ref);
 }
 
 void cfg_unref(ServerConfiguration *cfg) {
-    uint32_t ref = ucx_atomic_dec_32_nv(&cfg->ref);
+    uint32_t ref = ws_atomic_dec32(&cfg->ref);
     if(ref == 0) {
         // TODO: free configuration
     }
@@ -252,8 +252,8 @@
     
     sstr_t base = sstr("config/");
     sstr_t file;
-    file.length = base.length + mf.length + 1;
-    file.ptr = alloca(file.length);
+    file.length = base.length + mf.length;
+    file.ptr = alloca(file.length + 1);
     file.ptr[file.length] = 0;
     file = sstrncat(2, file, base, mf);
     

mercurial