summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordimitri staessens <[email protected]>2016-05-08 16:23:24 +0200
committerdimitri staessens <[email protected]>2016-05-08 16:23:24 +0200
commit021af9e01ce6c6376534b33ef1a06ea4189028d4 (patch)
tree93a02e1b20f54bb869eadc856f201412c633315c
parent7d0fcf6392be6a738d0ba7450b62f8c48062279a (diff)
downloadouroboros-021af9e01ce6c6376534b33ef1a06ea4189028d4.tar.gz
ouroboros-021af9e01ce6c6376534b33ef1a06ea4189028d4.zip
lib: changed SHM_AP_RBUFF to SHM_AP_RBUFF_PREFIX
This better reflects the use as the pid is appended to that name.
-rw-r--r--include/ouroboros/shm_ap_rbuff.h2
-rw-r--r--src/lib/shm_ap_rbuff.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/include/ouroboros/shm_ap_rbuff.h b/include/ouroboros/shm_ap_rbuff.h
index 070542b0..0ee3e81e 100644
--- a/include/ouroboros/shm_ap_rbuff.h
+++ b/include/ouroboros/shm_ap_rbuff.h
@@ -25,7 +25,7 @@
#define OUROBOROS_SHM_AP_RBUFF_H
#ifndef SHM_AP_RBUFF
-#define SHM_AP_RBUFF "ouroboros_rb_"
+#define SHM_AP_RBUFF_PREFIX "ouroboros_rb_"
#endif
#ifndef SHM_RBUFF_SIZE
diff --git a/src/lib/shm_ap_rbuff.c b/src/lib/shm_ap_rbuff.c
index 4bd64775..0a41dfb3 100644
--- a/src/lib/shm_ap_rbuff.c
+++ b/src/lib/shm_ap_rbuff.c
@@ -59,7 +59,7 @@ struct shm_ap_rbuff * shm_ap_rbuff_create()
pthread_mutexattr_t attr;
char fn[25];
- sprintf(fn, SHM_AP_RBUFF "%d", getpid());
+ sprintf(fn, SHM_AP_RBUFF_PREFIX "%d", getpid());
rb = malloc(sizeof(*rb));
if (rb == NULL) {
@@ -132,7 +132,7 @@ struct shm_ap_rbuff * shm_ap_rbuff_open(pid_t pid)
struct rb_entry * shm_base;
char fn[25];
- sprintf(fn, SHM_AP_RBUFF "%d", pid);
+ sprintf(fn, SHM_AP_RBUFF_PREFIX "%d", pid);
rb = malloc(sizeof(*rb));
if (rb == NULL) {
@@ -186,7 +186,7 @@ void shm_ap_rbuff_close(struct shm_ap_rbuff * rb)
return;
}
- sprintf(fn, SHM_AP_RBUFF "%d", rb->pid);
+ sprintf(fn, SHM_AP_RBUFF_PREFIX "%d", rb->pid);
if (munmap(rb->shm_base, SHM_RBUFF_FILE_SIZE) == -1)
LOG_DBGF("Couldn't unmap shared memory.");
@@ -209,7 +209,7 @@ void shm_ap_rbuff_destroy(struct shm_ap_rbuff * rb)
return;
}
- sprintf(fn, SHM_AP_RBUFF "%d", rb->pid);
+ sprintf(fn, SHM_AP_RBUFF_PREFIX "%d", rb->pid);
if (munmap(rb->shm_base, SHM_RBUFF_FILE_SIZE) == -1)
LOG_DBGF("Couldn't unmap shared memory.");