summaryrefslogtreecommitdiff
path: root/usr.bin/aucat/wav.c
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2009-02-04 20:35:15 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2009-02-04 20:35:15 +0000
commit751b5132bb874db9601b5e853ac78ff29a04c113 (patch)
tree0ef4b3d6bdf7c751c265d0a271d12d74eb8a8710 /usr.bin/aucat/wav.c
parentee4dbb556fd6b40c4aba4483d9401e7ebaf7bf2c (diff)
if there are too many connections, stop acceping new ones rather
than exit()ing with ``too many open files'' fatal error
Diffstat (limited to 'usr.bin/aucat/wav.c')
-rw-r--r--usr.bin/aucat/wav.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/usr.bin/aucat/wav.c b/usr.bin/aucat/wav.c
index 212fd2d7fff..1502488cfbf 100644
--- a/usr.bin/aucat/wav.c
+++ b/usr.bin/aucat/wav.c
@@ -35,6 +35,8 @@ wav_new_in(struct fileops *ops, int fd, char *name,
struct wav *f;
f = (struct wav *)pipe_new(ops, fd, name);
+ if (f == NULL)
+ return NULL;
if (hdr == HDR_WAV) {
if (!wav_readhdr(f->pipe.fd, par, &f->rbytes))
exit(1);
@@ -52,6 +54,8 @@ wav_new_out(struct fileops *ops, int fd, char *name,
struct wav *f;
f = (struct wav *)pipe_new(ops, fd, name);
+ if (f == NULL)
+ return NULL;
if (hdr == HDR_WAV) {
par->le = 1;
par->sig = (par->bits <= 8) ? 0 : 1;