summaryrefslogtreecommitdiff
path: root/ratox.c
diff options
context:
space:
mode:
Diffstat (limited to 'ratox.c')
-rw-r--r--ratox.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ratox.c b/ratox.c
index de07738..e30115e 100644
--- a/ratox.c
+++ b/ratox.c
@@ -1764,9 +1764,10 @@ loop(void)
toxav_answer(toxav, f->av.num, &toxavconfig);
break;
case av_CallActive:
- if ((fd = openat(f->dirfd, ffiles[FCALL_OUT].name, ffiles[FCALL_OUT].flags)) == -1 &&
- errno == ENXIO) {
- toxav_hangup(toxav, f->av.num);
+ fd = openat(f->dirfd, ffiles[FCALL_OUT].name, ffiles[FCALL_OUT].flags);
+ if (fd < 0) {
+ if (errno == ENXIO)
+ toxav_hangup(toxav, f->av.num);
} else {
close(fd);
}