on pthread_create failure, don't forget to unset & close handle

This commit is contained in:
martynas 2009-08-03 22:15:51 +00:00
parent 0ee6ce3add
commit 4b8293aba5
2 changed files with 7 additions and 4 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.24 2009/08/03 21:27:00 martynas Exp $
# $OpenBSD: Makefile,v 1.25 2009/08/03 22:15:51 martynas Exp $
SHARED_ONLY= Yes
ONLY_FOR_ARCHS= alpha amd64 arm i386 powerpc sparc sparc64
@ -7,7 +7,7 @@ COMMENT= redesign of Mozilla's browser component
VER= 3.5.2
DISTNAME= mozilla-1.9.1
PKGNAME= firefox35-${VER}
PKGNAME= firefox35-${VER}p0
SO_VERSION= 21.2
# NOTE: Must bump minor version if any shlib's are removed from the
# components dir to avoid pkg_add -r issues.

View File

@ -1,4 +1,4 @@
/* $OpenBSD: sydney_audio_sndio.c,v 1.2 2009/07/23 19:04:42 martynas Exp $ */
/* $OpenBSD: sydney_audio_sndio.c,v 1.3 2009/08/03 22:15:52 martynas Exp $ */
/*
* Copyright (c) 2009 Martynas Venckus <martynas@openbsd.org>
@ -161,8 +161,11 @@ sa_stream_open(sa_stream_t *s)
s->buffer = par.bufsz;
s->handle = handle;
if (pthread_create(&s->thread, NULL, (void *)audio_callback, s) != 0)
if (pthread_create(&s->thread, NULL, (void *)audio_callback, s) != 0) {
s->handle = NULL;
sio_close(handle);
return SA_ERROR_SYSTEM;
}
return SA_SUCCESS;
}