gui: Make some functions return void.
[paraslash.git] / afh.c
diff --git a/afh.c b/afh.c
index f2745b6..bffe632 100644 (file)
--- a/afh.c
+++ b/afh.c
@@ -124,7 +124,7 @@ static int cat_file(struct afh_info *afhi, int audio_format_id,
                        &header, &size);
                if (size > 0) {
                        PARA_INFO_LOG("writing header (%zu bytes)\n", size);
-                       ret = write(STDOUT_FILENO, header, size); /* FIXME */
+                       ret = write_all(STDOUT_FILENO, header, size);
                        afh_free_header(header, audio_format_id);
                        if (ret < 0)
                                return ret;
@@ -152,7 +152,7 @@ static int cat_file(struct afh_info *afhi, int audio_format_id,
                if (!size)
                        continue;
                PARA_INFO_LOG("writing chunk %lu\n", i);
-               ret = write_all(STDOUT_FILENO, buf, &size);
+               ret = write_all(STDOUT_FILENO, buf, size);
                if (ret < 0)
                        return ret;
        }
@@ -187,8 +187,10 @@ int main(int argc, char **argv)
                int ret2;
                ret = mmap_full_file(conf.inputs[i], O_RDONLY, &audio_file_data,
                        &audio_file_size, &fd);
-               if (ret < 0)
+               if (ret < 0) {
+                       PARA_ERROR_LOG("failed to mmap \"%s\"\n", conf.inputs[i]);
                        goto out;
+               }
                ret = compute_afhi(conf.inputs[i], audio_file_data, audio_file_size,
                        fd, &afhi);
                if (ret < 0)