gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnurl] 136/208: tests: Fix up issues with errno in test fi


From: gnunet
Subject: [GNUnet-SVN] [gnurl] 136/208: tests: Fix up issues with errno in test files
Date: Wed, 09 Aug 2017 17:35:33 +0200

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to annotated tag gnurl-7.55.0
in repository gnurl.

commit e909de65b907ae2be5874201b6881a5196e68c17
Author: Max Dymond <address@hidden>
AuthorDate: Mon Jul 10 13:50:15 2017 +0100

    tests: Fix up issues with errno in test files
    
    Closes https://github.com/curl/curl/pull/1671
---
 tests/libtest/lib505.c |  4 ++--
 tests/libtest/lib518.c | 16 ++++++++--------
 tests/libtest/lib525.c |  4 ++--
 tests/libtest/lib537.c | 16 ++++++++--------
 tests/libtest/lib541.c |  4 ++--
 tests/libtest/lib582.c |  4 ++--
 tests/libtest/lib591.c |  2 +-
 7 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/tests/libtest/lib505.c b/tests/libtest/lib505.c
index 127fde77e..0c128c666 100644
--- a/tests/libtest/lib505.c
+++ b/tests/libtest/lib505.c
@@ -55,7 +55,7 @@ int test(char *URL)
 
   hd_src = fopen(libtest_arg2, "rb");
   if(NULL == hd_src) {
-    error = ERRNO;
+    error = errno;
     fprintf(stderr, "fopen failed with error: %d %s\n",
             error, strerror(error));
     fprintf(stderr, "Error opening file: %s\n", libtest_arg2);
@@ -66,7 +66,7 @@ int test(char *URL)
   hd = fstat(fileno(hd_src), &file_info);
   if(hd == -1) {
     /* can't open file, bail out */
-    error = ERRNO;
+    error = errno;
     fprintf(stderr, "fstat() failed with error: %d %s\n",
             error, strerror(error));
     fprintf(stderr, "ERROR: cannot open file %s\n", libtest_arg2);
diff --git a/tests/libtest/lib518.c b/tests/libtest/lib518.c
index 960fcfca2..e2dcb440d 100644
--- a/tests/libtest/lib518.c
+++ b/tests/libtest/lib518.c
@@ -86,7 +86,7 @@ static int fopen_works(void)
   for(i = 0; i < 3; i++) {
     fpa[i] = fopen(DEV_NULL, FOPEN_READTEXT);
     if(fpa[i] == NULL) {
-      store_errmsg("fopen failed", ERRNO);
+      store_errmsg("fopen failed", errno);
       fprintf(stderr, "%s\n", msgbuff);
       ret = 0;
       break;
@@ -122,7 +122,7 @@ static int rlimit(int keep_open)
   /* get initial open file limits */
 
   if(getrlimit(RLIMIT_NOFILE, &rl) != 0) {
-    store_errmsg("getrlimit() failed", ERRNO);
+    store_errmsg("getrlimit() failed", errno);
     fprintf(stderr, "%s\n", msgbuff);
     return -1;
   }
@@ -169,7 +169,7 @@ static int rlimit(int keep_open)
       rl.rlim_cur = OPEN_MAX;
       if(setrlimit(RLIMIT_NOFILE, &rl) != 0) {
         /* on failure don't abort just issue a warning */
-        store_errmsg("setrlimit() failed", ERRNO);
+        store_errmsg("setrlimit() failed", errno);
         fprintf(stderr, "%s\n", msgbuff);
         msgbuff[0] = '\0';
       }
@@ -180,7 +180,7 @@ static int rlimit(int keep_open)
     rl.rlim_cur = rl.rlim_max;
     if(setrlimit(RLIMIT_NOFILE, &rl) != 0) {
       /* on failure don't abort just issue a warning */
-      store_errmsg("setrlimit() failed", ERRNO);
+      store_errmsg("setrlimit() failed", errno);
       fprintf(stderr, "%s\n", msgbuff);
       msgbuff[0] = '\0';
     }
@@ -188,7 +188,7 @@ static int rlimit(int keep_open)
     /* get current open file limits */
 
     if(getrlimit(RLIMIT_NOFILE, &rl) != 0) {
-      store_errmsg("getrlimit() failed", ERRNO);
+      store_errmsg("getrlimit() failed", errno);
       fprintf(stderr, "%s\n", msgbuff);
       return -3;
     }
@@ -268,7 +268,7 @@ static int rlimit(int keep_open)
     }
   } while(nitems && !memchunk);
   if(!memchunk) {
-    store_errmsg("memchunk, malloc() failed", ERRNO);
+    store_errmsg("memchunk, malloc() failed", errno);
     fprintf(stderr, "%s\n", msgbuff);
     return -5;
   }
@@ -303,7 +303,7 @@ static int rlimit(int keep_open)
 
   fd = malloc(sizeof(*fd) * (size_t)(num_open.rlim_max));
   if(!fd) {
-    store_errmsg("fd, malloc() failed", ERRNO);
+    store_errmsg("fd, malloc() failed", errno);
     fprintf(stderr, "%s\n", msgbuff);
     free(memchunk);
     return -7;
@@ -326,7 +326,7 @@ static int rlimit(int keep_open)
   fd[0] = open(DEV_NULL, O_RDONLY);
   if(fd[0] < 0) {
     snprintf(strbuff, sizeof(strbuff), "opening of %s failed", DEV_NULL);
-    store_errmsg(strbuff, ERRNO);
+    store_errmsg(strbuff, errno);
     fprintf(stderr, "%s\n", msgbuff);
     free(fd);
     fd = NULL;
diff --git a/tests/libtest/lib525.c b/tests/libtest/lib525.c
index 4bf259d21..f468efa25 100644
--- a/tests/libtest/lib525.c
+++ b/tests/libtest/lib525.c
@@ -55,7 +55,7 @@ int test(char *URL)
 
   hd_src = fopen(libtest_arg2, "rb");
   if(NULL == hd_src) {
-    error = ERRNO;
+    error = errno;
     fprintf(stderr, "fopen failed with error: %d (%s)\n",
             error, strerror(error));
     fprintf(stderr, "Error opening file: (%s)\n", libtest_arg2);
@@ -66,7 +66,7 @@ int test(char *URL)
   hd = fstat(fileno(hd_src), &file_info);
   if(hd == -1) {
     /* can't open file, bail out */
-    error = ERRNO;
+    error = errno;
     fprintf(stderr, "fstat() failed with error: %d (%s)\n",
             error, strerror(error));
     fprintf(stderr, "ERROR: cannot open file (%s)\n", libtest_arg2);
diff --git a/tests/libtest/lib537.c b/tests/libtest/lib537.c
index cfa1179d7..b5ee2ce5b 100644
--- a/tests/libtest/lib537.c
+++ b/tests/libtest/lib537.c
@@ -87,7 +87,7 @@ static int fopen_works(void)
   for(i = 0; i < 3; i++) {
     fpa[i] = fopen(DEV_NULL, FOPEN_READTEXT);
     if(fpa[i] == NULL) {
-      store_errmsg("fopen failed", ERRNO);
+      store_errmsg("fopen failed", errno);
       fprintf(stderr, "%s\n", msgbuff);
       ret = 0;
       break;
@@ -123,7 +123,7 @@ static int rlimit(int keep_open)
   /* get initial open file limits */
 
   if(getrlimit(RLIMIT_NOFILE, &rl) != 0) {
-    store_errmsg("getrlimit() failed", ERRNO);
+    store_errmsg("getrlimit() failed", errno);
     fprintf(stderr, "%s\n", msgbuff);
     return -1;
   }
@@ -164,7 +164,7 @@ static int rlimit(int keep_open)
       rl.rlim_cur = OPEN_MAX;
       if(setrlimit(RLIMIT_NOFILE, &rl) != 0) {
         /* on failure don't abort just issue a warning */
-        store_errmsg("setrlimit() failed", ERRNO);
+        store_errmsg("setrlimit() failed", errno);
         fprintf(stderr, "%s\n", msgbuff);
         msgbuff[0] = '\0';
       }
@@ -175,7 +175,7 @@ static int rlimit(int keep_open)
     rl.rlim_cur = rl.rlim_max;
     if(setrlimit(RLIMIT_NOFILE, &rl) != 0) {
       /* on failure don't abort just issue a warning */
-      store_errmsg("setrlimit() failed", ERRNO);
+      store_errmsg("setrlimit() failed", errno);
       fprintf(stderr, "%s\n", msgbuff);
       msgbuff[0] = '\0';
     }
@@ -183,7 +183,7 @@ static int rlimit(int keep_open)
     /* get current open file limits */
 
     if(getrlimit(RLIMIT_NOFILE, &rl) != 0) {
-      store_errmsg("getrlimit() failed", ERRNO);
+      store_errmsg("getrlimit() failed", errno);
       fprintf(stderr, "%s\n", msgbuff);
       return -3;
     }
@@ -242,7 +242,7 @@ static int rlimit(int keep_open)
     }
   } while(nitems && !memchunk);
   if(!memchunk) {
-    store_errmsg("memchunk, malloc() failed", ERRNO);
+    store_errmsg("memchunk, malloc() failed", errno);
     fprintf(stderr, "%s\n", msgbuff);
     return -4;
   }
@@ -297,7 +297,7 @@ static int rlimit(int keep_open)
     }
   } while(num_open.rlim_max && !fd);
   if(!fd) {
-    store_errmsg("fd, malloc() failed", ERRNO);
+    store_errmsg("fd, malloc() failed", errno);
     fprintf(stderr, "%s\n", msgbuff);
     free(memchunk);
     return -6;
@@ -320,7 +320,7 @@ static int rlimit(int keep_open)
   fd[0] = open(DEV_NULL, O_RDONLY);
   if(fd[0] < 0) {
     snprintf(strbuff, sizeof(strbuff), "opening of %s failed", DEV_NULL);
-    store_errmsg(strbuff, ERRNO);
+    store_errmsg(strbuff, errno);
     fprintf(stderr, "%s\n", msgbuff);
     free(fd);
     fd = NULL;
diff --git a/tests/libtest/lib541.c b/tests/libtest/lib541.c
index 3e9cb3ccd..9aa4a0826 100644
--- a/tests/libtest/lib541.c
+++ b/tests/libtest/lib541.c
@@ -47,7 +47,7 @@ int test(char *URL)
 
   hd_src = fopen(libtest_arg2, "rb");
   if(NULL == hd_src) {
-    error = ERRNO;
+    error = errno;
     fprintf(stderr, "fopen failed with error: %d %s\n",
             error, strerror(error));
     fprintf(stderr, "Error opening file: %s\n", libtest_arg2);
@@ -58,7 +58,7 @@ int test(char *URL)
   hd = fstat(fileno(hd_src), &file_info);
   if(hd == -1) {
     /* can't open file, bail out */
-    error = ERRNO;
+    error = errno;
     fprintf(stderr, "fstat() failed with error: %d %s\n",
             error, strerror(error));
     fprintf(stderr, "ERROR: cannot open file %s\n", libtest_arg2);
diff --git a/tests/libtest/lib582.c b/tests/libtest/lib582.c
index d7e4dd1bf..23772be59 100644
--- a/tests/libtest/lib582.c
+++ b/tests/libtest/lib582.c
@@ -244,7 +244,7 @@ int test(char *URL)
 
   hd_src = fopen(libtest_arg2, "rb");
   if(NULL == hd_src) {
-    error = ERRNO;
+    error = errno;
     fprintf(stderr, "fopen() failed with error: %d (%s)\n",
             error, strerror(error));
     fprintf(stderr, "Error opening file: (%s)\n", libtest_arg2);
@@ -255,7 +255,7 @@ int test(char *URL)
   hd = fstat(fileno(hd_src), &file_info);
   if(hd == -1) {
     /* can't open file, bail out */
-    error = ERRNO;
+    error = errno;
     fprintf(stderr, "fstat() failed with error: %d (%s)\n",
             error, strerror(error));
     fprintf(stderr, "ERROR: cannot open file (%s)\n", libtest_arg2);
diff --git a/tests/libtest/lib591.c b/tests/libtest/lib591.c
index 7d50f894c..c04d3fbae 100644
--- a/tests/libtest/lib591.c
+++ b/tests/libtest/lib591.c
@@ -50,7 +50,7 @@ int test(char *URL)
 
   upload = fopen(libtest_arg3, "rb");
   if(!upload) {
-    error = ERRNO;
+    error = errno;
     fprintf(stderr, "fopen() failed with error: %d (%s)\n",
             error, strerror(error));
     fprintf(stderr, "Error opening file: (%s)\n", libtest_arg3);

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]