consolidate close() calls to pa_close(), and make sure on every occasion that we handle failures of close() sensibly

git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1811 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Lennart Poettering 2007-09-12 00:04:21 +00:00
parent 54506ab44a
commit 7f92542420
18 changed files with 89 additions and 81 deletions

View file

@ -65,7 +65,7 @@ int pa__init(pa_module*m) {
if (pa_loop_write(fd, &x, sizeof(x), NULL) != sizeof(x))
pa_log_warn("WARNING: write(%u, 1, 1) failed: %s", fd, pa_cstrerror(errno));
close(fd);
pa_assert_se(pa_close(fd) == 0);
pa_module_unload_request(m);

View file

@ -254,7 +254,7 @@ void pa__done(pa_module*m) {
m->core->mainloop->io_free(u->io);
if (u->fd >= 0)
close(u->fd);
pa_assert_se(pa_close(u->fd) == 0);
pa_xfree(u->sink_name);
pa_xfree(u);

View file

@ -476,7 +476,7 @@ static int suspend(struct userdata *u) {
/* Let's suspend */
ioctl(u->fd, SNDCTL_DSP_SYNC, NULL);
close(u->fd);
pa_close(u->fd);
u->fd = -1;
if (u->rtpoll_item) {
@ -588,7 +588,7 @@ static int unsuspend(struct userdata *u) {
return 0;
fail:
close(u->fd);
pa_close(u->fd);
u->fd = -1;
return -1;
}
@ -1324,7 +1324,7 @@ fail:
if (u)
pa__done(m);
else if (fd >= 0)
close(fd);
pa_close(fd);
if (ma)
pa_modargs_free(ma);
@ -1391,7 +1391,7 @@ void pa__done(pa_module*m) {
munmap(u->out_mmap, u->out_hwbuf_size);
if (u->fd >= 0)
close(u->fd);
pa_close(u->fd);
pa_xfree(u->device_name);

View file

@ -335,7 +335,7 @@ void pa__done(pa_module*m) {
}
if (u->fd >= 0)
close(u->fd);
pa_assert_se(pa_close(u->fd) == 0);
pa_xfree(u);
}

View file

@ -313,7 +313,7 @@ void pa__done(pa_module*m) {
}
if (u->fd >= 0)
close(u->fd);
pa_assert_se(pa_close(u->fd) == 0);
pa_xfree(u);
}

View file

@ -68,7 +68,7 @@ int pa_oss_open(const char *device, int *mode, int* pcaps) {
pa_log_warn("'%s' doesn't support full duplex", device);
close(fd);
pa_close(fd);
}
if ((fd = open(device, (*mode = O_WRONLY)|O_NDELAY|O_NOCTTY)) < 0) {
@ -147,7 +147,7 @@ success:
fail:
if (fd >= 0)
close(fd);
pa_close(fd);
return -1;
}