summaryrefslogtreecommitdiff
path: root/src/lib/dev.c
diff options
context:
space:
mode:
authorSander Vrijders <[email protected]>2016-07-05 19:11:26 +0200
committerSander Vrijders <[email protected]>2016-07-05 19:11:26 +0200
commit6c799af1b4cf86a32979d98034c560fb976a9caf (patch)
treef9072634e81bc152c0ca52b927ab9984a845e0e8 /src/lib/dev.c
parentdb96f7d488681be47abfeec6c636fd4159a37660 (diff)
parentbc9c60382b226e5a75a11a99364b9b799dc2b0c2 (diff)
downloadouroboros-6c799af1b4cf86a32979d98034c560fb976a9caf.tar.gz
ouroboros-6c799af1b4cf86a32979d98034c560fb976a9caf.zip
Merged in dstaesse/ouroboros/be-pid (pull request #157)
lib: Change invalid pid to -1
Diffstat (limited to 'src/lib/dev.c')
-rw-r--r--src/lib/dev.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/dev.c b/src/lib/dev.c
index 19bc90e5..d85afc45 100644
--- a/src/lib/dev.c
+++ b/src/lib/dev.c
@@ -93,7 +93,7 @@ int ap_init(char * ap_name)
for (i = 0; i < AP_MAX_FLOWS; ++i) {
_ap_instance->flows[i].rb = NULL;
_ap_instance->flows[i].port_id = -1;
- _ap_instance->flows[i].api = 0; /* API_INVALID */
+ _ap_instance->flows[i].api = -1;
}
pthread_rwlock_init(&_ap_instance->flows_lock, NULL);
@@ -397,7 +397,7 @@ int flow_dealloc(int fd)
_ap_instance->flows[fd].port_id = -1;
shm_ap_rbuff_close(_ap_instance->flows[fd].rb);
_ap_instance->flows[fd].rb = NULL;
- _ap_instance->flows[fd].api = 0;
+ _ap_instance->flows[fd].api = -1;
bmp_release(_ap_instance->fds, fd);
@@ -543,7 +543,7 @@ ssize_t flow_read(int fd, void * buf, size_t count)
if (_ap_instance->flows[fd].oflags & FLOW_O_NONBLOCK) {
idx = shm_ap_rbuff_read_port(_ap_instance->rb,
- _ap_instance->flows[fd].port_id);
+ _ap_instance->flows[fd].port_id);
} else { /* block */
while ((idx =
shm_ap_rbuff_read_port(_ap_instance->rb,