summaryrefslogtreecommitdiff
path: root/src/lib/shm_ap_rbuff.c
diff options
context:
space:
mode:
authorSander Vrijders <[email protected]>2016-06-28 16:38:03 +0200
committerSander Vrijders <[email protected]>2016-06-28 16:45:45 +0200
commit99d19307fae8f1370f52a62aee88fded624ad464 (patch)
tree36b94730d8690c2d131f39b3cc3ff715674f9fcc /src/lib/shm_ap_rbuff.c
parent0d789ed8d938cc342c8f2138280795a1d5a61e3d (diff)
downloadouroboros-99d19307fae8f1370f52a62aee88fded624ad464.tar.gz
ouroboros-99d19307fae8f1370f52a62aee88fded624ad464.zip
lib, irmd, ipcpd: Change pid to api
Changes the variable name as well to API instead of PID.
Diffstat (limited to 'src/lib/shm_ap_rbuff.c')
-rw-r--r--src/lib/shm_ap_rbuff.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/shm_ap_rbuff.c b/src/lib/shm_ap_rbuff.c
index 6ee2936c..69e96c40 100644
--- a/src/lib/shm_ap_rbuff.c
+++ b/src/lib/shm_ap_rbuff.c
@@ -55,7 +55,7 @@ struct shm_ap_rbuff {
size_t * ptr_tail; /* start of ringbuffer tail */
pthread_mutex_t * shm_mutex; /* lock all free space in shm */
pthread_cond_t * work; /* threads will wait for a signal */
- pid_t pid; /* pid to which this rb belongs */
+ pid_t api; /* api to which this rb belongs */
int fd;
};
@@ -138,19 +138,19 @@ struct shm_ap_rbuff * shm_ap_rbuff_create()
*rb->ptr_tail = 0;
rb->fd = shm_fd;
- rb->pid = getpid();
+ rb->api = getpid();
return rb;
}
-struct shm_ap_rbuff * shm_ap_rbuff_open(pid_t pid)
+struct shm_ap_rbuff * shm_ap_rbuff_open(pid_t api)
{
struct shm_ap_rbuff * rb;
int shm_fd;
struct rb_entry * shm_base;
char fn[25];
- sprintf(fn, SHM_AP_RBUFF_PREFIX "%d", pid);
+ sprintf(fn, SHM_AP_RBUFF_PREFIX "%d", api);
rb = malloc(sizeof(*rb));
if (rb == NULL) {
@@ -190,7 +190,7 @@ struct shm_ap_rbuff * shm_ap_rbuff_open(pid_t pid)
rb->work = (pthread_cond_t *) (rb->shm_mutex + 1);
rb->fd = shm_fd;
- rb->pid = pid;
+ rb->api = api;
return rb;
}
@@ -219,7 +219,7 @@ void shm_ap_rbuff_destroy(struct shm_ap_rbuff * rb)
return;
}
- if (rb->pid != getpid()) {
+ if (rb->api != getpid()) {
LOG_ERR("Tried to destroy other AP's rbuff.");
return;
}
@@ -227,7 +227,7 @@ void shm_ap_rbuff_destroy(struct shm_ap_rbuff * rb)
if (close(rb->fd) < 0)
LOG_DBGF("Couldn't close shared memory.");
- sprintf(fn, SHM_AP_RBUFF_PREFIX "%d", rb->pid);
+ sprintf(fn, SHM_AP_RBUFF_PREFIX "%d", rb->api);
if (munmap(rb->shm_base, SHM_RBUFF_FILE_SIZE) == -1)
LOG_DBGF("Couldn't unmap shared memory.");