summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/talk.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/talk.c b/apps/talk.c
index e440dd98b5..1be2a041c2 100644
--- a/apps/talk.c
+++ b/apps/talk.c
@@ -552,8 +552,8 @@ alloc_err:
552} 552}
553static inline int load_voicefile_failure(int fd) 553static inline int load_voicefile_failure(int fd)
554{ 554{
555 /*if (fd >= 0) probably redundant */ 555 if (fd >= 0)
556 close(fd); 556 close(fd);
557 return -1; 557 return -1;
558} 558}
559/* load the voice file into the mp3 buffer */ 559/* load the voice file into the mp3 buffer */
@@ -829,7 +829,7 @@ void talk_init(void)
829 * and so we can re-use it if it's already allocated in any event */ 829 * and so we can re-use it if it's already allocated in any event */
830 830
831 filehandle = open_voicefile(); 831 filehandle = open_voicefile();
832 if (filehandle > -1) 832 if (filehandle >= 0)
833 { 833 {
834 if (!load_voicefile_index(filehandle)) 834 if (!load_voicefile_index(filehandle))
835 { 835 {
@@ -880,7 +880,8 @@ void talk_init(void)
880 voice_thread_init(); 880 voice_thread_init();
881 881
882out: 882out:
883 close(filehandle); /* close again, this was just to detect presence */ 883 if (filehandle >= 0)
884 close(filehandle); /* close again, this was just to detect presence */
884} 885}
885 886
886/* somebody else claims the mp3 buffer, e.g. for regular play/record */ 887/* somebody else claims the mp3 buffer, e.g. for regular play/record */