projects
/
aubio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bc6c1a7
)
src/io/source_wavread.c: avoid calling fclose twice, print an error if fclose fails
author
Paul Brossier
<piem@piem.org>
Mon, 3 Feb 2014 19:21:11 +0000
(16:21 -0300)
committer
Paul Brossier
<piem@piem.org>
Mon, 3 Feb 2014 19:21:11 +0000
(16:21 -0300)
src/io/source_wavread.c
patch
|
blob
|
history
diff --git
a/src/io/source_wavread.c
b/src/io/source_wavread.c
index
d587868
..
2058b44
100644
(file)
--- a/
src/io/source_wavread.c
+++ b/
src/io/source_wavread.c
@@
-347,9
+347,14
@@
uint_t aubio_source_wavread_seek (aubio_source_wavread_t * s, uint_t pos) {
}
uint_t aubio_source_wavread_close (aubio_source_wavread_t * s) {
- if (!s->fid || fclose(s->fid)) {
+ if (!s->fid) {
+ return AUBIO_FAIL;
+ }
+ if (fclose(s->fid)) {
+ AUBIO_ERR("source_wavread: could not close %s (%s)\n", s->path, strerror(errno));
return AUBIO_FAIL;
}
+ s->fid = NULL;
return AUBIO_OK;
}