changeset 1428:9eecf7e5e23e

Get rid of direct errno usage.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 15 Nov 2017 07:41:58 +0200
parents ae1fcae5e622
children b117047ad8f3
files tools/data2inc.c
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/tools/data2inc.c	Wed Nov 15 07:41:25 2017 +0200
+++ b/tools/data2inc.c	Wed Nov 15 07:41:58 2017 +0200
@@ -5,7 +5,6 @@
  *
  * Please read file 'COPYING' for information on license and distribution.
  */
-#include <errno.h>
 #include "dmlib.h"
 #include "dmargs.h"
 #include "dmmutex.h"
@@ -339,9 +338,9 @@
     else
     if ((sfile = fopen(optInFilename, "rb")) == NULL)
     {
-        tmpRes = errno;
+        tmpRes = dmGetErrno();
         dmErrorMsg("Error opening input file '%s'. (%s)\n",
-            optInFilename, strerror(tmpRes));
+            optInFilename, dmErrorStr(tmpRes));
         exit(3);
     }
 
@@ -350,9 +349,9 @@
     else
     if ((dfile = fopen(optOutFilename, "wa")) == NULL)
     {
-        tmpRes = errno;
+        tmpRes = dmGetErrno();
         dmErrorMsg("Error creating output file '%s'. (%s)\n",
-            optOutFilename, strerror(tmpRes));
+            optOutFilename, dmErrorStr(tmpRes));
         exit(4);
     }
 
@@ -399,6 +398,5 @@
     fclose(sfile);
     fclose(dfile);
 
-    exit(0);
     return 0;
 }