Some cleanup. Removed sharedmemory_global.h
authorMartin Johansson <martin@fatbob.nu>
Sun, 7 Dec 2014 20:37:16 +0000 (21:37 +0100)
committerMartin Johansson <martin@fatbob.nu>
Sun, 7 Dec 2014 20:37:16 +0000 (21:37 +0100)
shm_utils/mon-umurmurd/mon-umurmurd.c
src/sharedmemory.c
src/sharedmemory_global.h [deleted file]
src/sharedmemory_struct.h

index 7cd5697f68abcbab3d98fdb0c4eec86516ed86c5..393be378491c61c488d585d1cd16a823ee6131e8 100644 (file)
@@ -7,11 +7,14 @@
 #include <sys/stat.h>\r
 #include <sys/mman.h>\r
 #include <sys/types.h>\r
-#include "../../src/sharedmemory.h"\r
-#include "../../src/sharedmemory_global.h"\r
+#include "../../src/sharedmemory_struct.h"\r
 \r
 enum{ NOP_SHM, WAIT_ATTACH_SHM, TRY_ATTACH_SHM, MAT_SHM, CLEAN_UP_SHM, RUN_SHM };\r
 \r
+int shm_fd;\r
+shm_t *shmptr = NULL;\r
+char shm_file_name[128];\r
+\r
 int wait = 0, opt;\r
 uint8_t last, shm_statem = TRY_ATTACH_SHM;\r
 \r
@@ -161,4 +164,4 @@ int cc;
         {\r
             exit(EXIT_FAILURE); //You dont have to exit you could just report the fact that the data is not valid \r
         }\r
-}
\ No newline at end of file
+}\r
index 9018f5cbd7d35bfd93cc39d956ec87c6151add75..c2b703ab5ba0697d13a7f7ffe5d0cefc661f0014 100644 (file)
@@ -1,5 +1,8 @@
 #include "sharedmemory.h"\r
-#include "sharedmemory_global.h"\r
+\r
+int shm_fd;\r
+shm_t *shmptr = NULL;\r
+char shm_file_name[128];\r
 \r
 void Sharedmemory_init( int bindport, int bindport6 ) \r
 {\r
@@ -114,4 +117,4 @@ void Sharedmemory_deinit(void)
   close( shm_fd );\r
   shm_unlink( shm_file_name );\r
   shmptr->umurmurd_pid = 0;\r
-}
\ No newline at end of file
+}\r
diff --git a/src/sharedmemory_global.h b/src/sharedmemory_global.h
deleted file mode 100644 (file)
index b68fcde..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-int shm_fd;\r
-shm_t *shmptr = NULL;\r
-char shm_file_name[128];\r
index a36382e8e425126e720643cc7ce3ab8d3e1591d0..de356c428fbab8c0ab07b0fd8f4d93acbf536812 100644 (file)
@@ -1,3 +1,7 @@
+#include <arpa/inet.h>\r
+#include <stdint.h>\r
+#include "types.h"\r
+\r
 typedef struct\r
 {\r
 \r