changeset 186:2f129ea15405

Adjust to new th_io_fopen() API.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 09 Jul 2018 08:10:50 +0300
parents 2dfe46fda09e
children cf081a98dccd
files sidinfo.c
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/sidinfo.c	Mon Jul 09 08:05:49 2018 +0300
+++ b/sidinfo.c	Mon Jul 09 08:10:50 2018 +0300
@@ -968,13 +968,15 @@
     th_ioctx *inFile = NULL;
     FILE *outFile;
     BOOL shown = FALSE;
+    int res;
 
     optNFiles++;
     outFile = stdout;
 
-    if ((inFile = th_io_fopen(&th_stdio_io_ops, filename, "rb")) == NULL)
+    if ((res = th_io_fopen(&inFile, &th_stdio_io_ops, filename, "rb")) != THERR_OK)
     {
-        THERR("Could not open file '%s'.\n", filename);
+        THERR("Could not open file '%s': %s\n",
+            filename, th_error_str(res));
         goto error;
     }
 
@@ -1092,10 +1094,10 @@
         // Initialize SLDB
         int ret = THERR_OK;
         th_ioctx *inFile = NULL;
-        if ((inFile = th_io_fopen(&th_stdio_io_ops, setSLDBPath, "r")) == NULL)
+        if ((ret = th_io_fopen(&inFile, &th_stdio_io_ops, setSLDBPath, "r")) != THERR_OK)
         {
-            THERR("Could not open SLDB '%s'.\n",
-                setSLDBPath);
+            THERR("Could not open SLDB '%s': %s\n",
+                setSLDBPath, th_error_str(ret));
             goto err;
         }