changeset 472:d553a41aab6c

display the error on mkdtemp failure....
author Louis Opter <kalessin@kalessin.fr>
date Tue, 21 Jun 2016 10:07:55 -0700
parents 3acc9eca7df9
children 59061c76f3b2
files mkdtemp_error_handling.patch
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mkdtemp_error_handling.patch	Mon Jun 20 23:33:26 2016 -0700
+++ b/mkdtemp_error_handling.patch	Tue Jun 21 10:07:55 2016 -0700
@@ -1,5 +1,5 @@
 # HG changeset patch
-# Parent  a427bc665234bd40731e481f96a9273510a6e4d3
+# Parent  37abecb2b0d3417349a2081a541cfbe4609f6892
 Improve error handling in lgtd_tests_make_temp_dir
 
 Hopefully let me solve those segfaults in the unit-tests of the pipe
@@ -8,7 +8,7 @@
 diff --git a/tests/core/tests_utils.c b/tests/core/tests_utils.c
 --- a/tests/core/tests_utils.c
 +++ b/tests/core/tests_utils.c
-@@ -186,10 +186,13 @@
+@@ -180,10 +180,13 @@
  {
      char buf[PATH_MAX] = { 0 };
      int n = snprintf(buf, sizeof(buf), "%s/lightsd.test.XXXXXXXX", P_tmpdir);
@@ -19,7 +19,7 @@
      }
 -    return strdup(mkdtemp(buf));
 +    if (!mkdtemp(buf)) {
-+        lgtd_errx(1, "cannot create temporary directory");
++        lgtd_err(1, "cannot create temporary directory");
 +    }
 +    return strdup(buf);
  }