All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] More informative error messages from SAFE_*?
@ 2014-04-16  7:15 Mats Liljegren
  2014-04-16 15:52 ` chrubis
  2014-04-16 17:27 ` [LTP] [PATCH] Make SAFE_* calls more informative when failing Mats Liljegren
  0 siblings, 2 replies; 7+ messages in thread
From: Mats Liljegren @ 2014-04-16  7:15 UTC (permalink / raw)
  To: ltp-list

I ran into problems when using SAFE_OPEN, it complained about a
non-existing path. It didn't tell me what path it tried, which made
debugging more difficult than necessary.

I'm prepared to change the error messages in safe_macros.c to have a
syntax similar to what I plan for safe_open():

		tst_brkm(TBROK | TERRNO, cleanup_fn,
			"%s:%d: open(%s,%d) failed",
			file, lineno, pathname, oflags);


I skipped the creation mode parameter since it was too much work
handling an optional parameter...

Would anyone see a point in having all functions using a similar error
syntax?

Regards
Mats Liljegren

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [LTP] More informative error messages from SAFE_*?
  2014-04-16  7:15 [LTP] More informative error messages from SAFE_*? Mats Liljegren
@ 2014-04-16 15:52 ` chrubis
  2014-04-16 17:27 ` [LTP] [PATCH] Make SAFE_* calls more informative when failing Mats Liljegren
  1 sibling, 0 replies; 7+ messages in thread
From: chrubis @ 2014-04-16 15:52 UTC (permalink / raw)
  To: Mats Liljegren; +Cc: ltp-list

Hi!
> I ran into problems when using SAFE_OPEN, it complained about a
> non-existing path. It didn't tell me what path it tried, which made
> debugging more difficult than necessary.
> 
> I'm prepared to change the error messages in safe_macros.c to have a
> syntax similar to what I plan for safe_open():
> 
> 		tst_brkm(TBROK | TERRNO, cleanup_fn,
> 			"%s:%d: open(%s,%d) failed",
> 			file, lineno, pathname, oflags);
> 
> 
> I skipped the creation mode parameter since it was too much work
> handling an optional parameter...
> 
> Would anyone see a point in having all functions using a similar error
> syntax?

Sounds good to me.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [LTP] [PATCH] Make SAFE_* calls more informative when failing
  2014-04-16  7:15 [LTP] More informative error messages from SAFE_*? Mats Liljegren
  2014-04-16 15:52 ` chrubis
@ 2014-04-16 17:27 ` Mats Liljegren
  2014-04-16 17:27   ` Mats Liljegren
  2014-04-22 13:24   ` Mats Liljegren
  1 sibling, 2 replies; 7+ messages in thread
From: Mats Liljegren @ 2014-04-16 17:27 UTC (permalink / raw)
  To: ltp-list


When debugging failing test cases I often missed what parameters were used in
those SAFE_* calls. This patch is meant to fix this.

The output has been "standardized" into the following format:
<file>:<line>: <func>(<params>) <error message>

E.g.:
test.c:130: chdir(mydir) failed

This will then be followed by the usual errno stuff if applicable.

The code compiles, but I haven't figured out a good way of testing it. The
changes are pretty simple however.

Regards
Mats Liljegren

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [LTP] [PATCH] Make SAFE_* calls more informative when failing
  2014-04-16 17:27 ` [LTP] [PATCH] Make SAFE_* calls more informative when failing Mats Liljegren
@ 2014-04-16 17:27   ` Mats Liljegren
  2014-04-22 13:41     ` chrubis
  2014-04-22 13:24   ` Mats Liljegren
  1 sibling, 1 reply; 7+ messages in thread
From: Mats Liljegren @ 2014-04-16 17:27 UTC (permalink / raw)
  To: ltp-list

The output has been "standardized" into the following format:
<file>:<line>: <func>(<params>) <error message>

E.g.:
test.c:130: chdir(mydir) failed

This will then be followed by the usual errno stuff if applicable.

Signed-off-by: Mats Liljegren <mats.liljegren@enea.com>
---
 lib/safe_macros.c |  170 +++++++++++++++++++++++++++++++----------------------
 1 file changed, 100 insertions(+), 70 deletions(-)

diff --git a/lib/safe_macros.c b/lib/safe_macros.c
index 6f85c11..4be4fc2 100644
--- a/lib/safe_macros.c
+++ b/lib/safe_macros.c
@@ -20,8 +20,9 @@ char *safe_basename(const char *file, const int lineno,
 
 	rval = basename(path);
 	if (rval == NULL)
-		tst_brkm(TBROK | TERRNO, cleanup_fn, "basename failed at %s:%d",
-			 file, lineno);
+		tst_brkm(TBROK | TERRNO, cleanup_fn,
+			 "%s:%d: basename(%s) failed",
+			 file, lineno, path);
 
 	return (rval);
 }
@@ -34,8 +35,9 @@ safe_chdir(const char *file, const int lineno, void (*cleanup_fn) (void),
 
 	rval = chdir(path);
 	if (rval == -1)
-		tst_brkm(TBROK | TERRNO, cleanup_fn, "chdir failed at %s:%d",
-			 file, lineno);
+		tst_brkm(TBROK | TERRNO, cleanup_fn,
+			 "%s:%d: chdir(%s) failed",
+			 file, lineno, path);
 
 	return (rval);
 }
@@ -48,8 +50,9 @@ safe_close(const char *file, const int lineno, void (*cleanup_fn) (void),
 
 	rval = close(fildes);
 	if (rval == -1)
-		tst_brkm(TBROK | TERRNO, cleanup_fn, "close failed at %s:%d",
-			 file, lineno);
+		tst_brkm(TBROK | TERRNO, cleanup_fn,
+			 "%s:%d: close(%d) failed",
+			 file, lineno, fildes);
 
 	return (rval);
 }
@@ -62,8 +65,9 @@ safe_creat(const char *file, const int lineno, void (*cleanup_fn) (void),
 
 	rval = creat(pathname, mode);
 	if (rval == -1)
-		tst_brkm(TBROK | TERRNO, cleanup_fn, "creat failed at %s:%d",
-			 file, lineno);
+		tst_brkm(TBROK | TERRNO, cleanup_fn,
+			 "%s:%d: creat(%s,%d) failed",
+			 file, lineno, pathname, mode);
 
 	return (rval);
 }
@@ -75,8 +79,9 @@ char *safe_dirname(const char *file, const int lineno,
 
 	rval = dirname(path);
 	if (rval == NULL)
-		tst_brkm(TBROK | TERRNO, cleanup_fn, "dirname failed at %s:%d",
-			 file, lineno);
+		tst_brkm(TBROK | TERRNO, cleanup_fn,
+			 "%s:%d: dirname(%s) failed",
+			 file, lineno, path);
 
 	return (rval);
 }
@@ -88,8 +93,9 @@ char *safe_getcwd(const char *file, const int lineno, void (*cleanup_fn) (void),
 
 	rval = getcwd(buf, size);
 	if (rval == NULL)
-		tst_brkm(TBROK | TERRNO, cleanup_fn, "getcwd failed at %s:%d",
-			 file, lineno);
+		tst_brkm(TBROK | TERRNO, cleanup_fn,
+			 "%s:%d: getcwd(%p,%zu) failed",
+			 file, lineno, buf, size);
 
 	return (rval);
 }
@@ -101,8 +107,9 @@ struct passwd *safe_getpwnam(const char *file, const int lineno,
 
 	rval = getpwnam(name);
 	if (rval == NULL)
-		tst_brkm(TBROK | TERRNO, cleanup_fn, "getpwnam failed at %s:%d",
-			 file, lineno);
+		tst_brkm(TBROK | TERRNO, cleanup_fn,
+			 "%s:%d: getpwnam(%s) failed",
+			 file, lineno, name);
 
 	return (rval);
 }
@@ -116,7 +123,8 @@ safe_getrusage(const char *file, const int lineno, void (*cleanup_fn) (void),
 	rval = getrusage(who, usage);
 	if (rval == -1)
 		tst_brkm(TBROK | TERRNO, cleanup_fn,
-			 "getrusage failed at %s:%d", file, lineno);
+			 "%s:%d: getrusage(%d,%p) failed",
+			 file, lineno, who, usage);
 
 	return rval;
 }
@@ -128,8 +136,9 @@ void *safe_malloc(const char *file, const int lineno, void (*cleanup_fn) (void),
 
 	rval = malloc(size);
 	if (rval == NULL)
-		tst_brkm(TBROK | TERRNO, cleanup_fn, "malloc failed at %s:%d",
-			 file, lineno);
+		tst_brkm(TBROK | TERRNO, cleanup_fn,
+			 "%s:%d: malloc(%zu) failed",
+			 file, lineno, size);
 
 	return (rval);
 }
@@ -142,8 +151,9 @@ safe_mkdir(const char *file, const int lineno, void (*cleanup_fn) (void),
 
 	rval = mkdir(pathname, mode);
 	if (rval == -1)
-		tst_brkm(TBROK | TERRNO, cleanup_fn, "mkdir failed at %s:%d",
-			 file, lineno);
+		tst_brkm(TBROK | TERRNO, cleanup_fn,
+			 "%s:%d: mkdir(%s,0%o) failed",
+			 file, lineno, pathname, mode);
 
 	return (rval);
 }
@@ -156,8 +166,10 @@ void *safe_mmap(const char *file, const int lineno, void (*cleanup_fn) (void),
 
 	rval = mmap(addr, length, prot, flags, fd, offset);
 	if (rval == MAP_FAILED)
-		tst_brkm(TBROK | TERRNO, cleanup_fn, "mmap failed at %s:%d",
-			 file, lineno);
+		tst_brkm(TBROK | TERRNO, cleanup_fn,
+			 "%s:%d: mmap(%p,%zu,%d,%d,%d,%ld) failed",
+			 file, lineno, addr, length, prot, flags, fd,
+			 (long) offset);
 
 	return (rval);
 }
@@ -170,8 +182,9 @@ safe_munmap(const char *file, const int lineno, void (*cleanup_fn) (void),
 
 	rval = munmap(addr, length);
 	if (rval == -1)
-		tst_brkm(TBROK | TERRNO, cleanup_fn, "munmap failed at %s:%d",
-			 file, lineno);
+		tst_brkm(TBROK | TERRNO, cleanup_fn,
+			 "%s:%d: munmap(%p,%zu) failed",
+			 file, lineno, addr, length);
 
 	return (rval);
 }
@@ -190,8 +203,9 @@ safe_open(const char *file, const int lineno, void (*cleanup_fn) (void),
 
 	rval = open(pathname, oflags, mode);
 	if (rval == -1)
-		tst_brkm(TBROK | TERRNO, cleanup_fn, "open failed at %s:%d",
-			 file, lineno);
+		tst_brkm(TBROK | TERRNO, cleanup_fn,
+			 "%s:%d: open(%s,%d) failed",
+			 file, lineno, pathname, oflags);
 
 	return (rval);
 }
@@ -204,8 +218,9 @@ safe_pipe(const char *file, const int lineno, void (*cleanup_fn) (void),
 
 	rval = pipe(fildes);
 	if (rval == -1)
-		tst_brkm(TBROK | TERRNO, cleanup_fn, "pipe failed at %s:%d",
-			 file, lineno);
+		tst_brkm(TBROK | TERRNO, cleanup_fn,
+			 "%s:%d: pipe({%d,%d}) failed",
+			 file, lineno, fildes[0], fildes[1]);
 
 	return (rval);
 }
@@ -218,8 +233,9 @@ safe_read(const char *file, const int lineno, void (*cleanup_fn) (void),
 
 	rval = read(fildes, buf, nbyte);
 	if (rval == -1 || (len_strict && (size_t)rval != nbyte))
-		tst_brkm(TBROK | TERRNO, cleanup_fn, "read failed at %s:%d",
-			 file, lineno);
+		tst_brkm(TBROK | TERRNO, cleanup_fn,
+			 "%s:%d: read(%d,%p,%zu) failed, returned %zd",
+			 file, lineno, fildes, buf, nbyte, rval);
 
 	return (rval);
 }
@@ -232,8 +248,9 @@ safe_setegid(const char *file, const int lineno, void (*cleanup_fn) (void),
 
 	rval = setegid(egid);
 	if (rval == -1)
-		tst_brkm(TBROK | TERRNO, cleanup_fn, "setegid failed at %s:%d",
-			 file, lineno);
+		tst_brkm(TBROK | TERRNO, cleanup_fn,
+			 "%s:%d: setegid(%u) failed",
+			 file, lineno, (unsigned) egid);
 
 	return (rval);
 }
@@ -246,8 +263,9 @@ safe_seteuid(const char *file, const int lineno, void (*cleanup_fn) (void),
 
 	rval = seteuid(euid);
 	if (rval == -1)
-		tst_brkm(TBROK | TERRNO, cleanup_fn, "seteuid failed at %s:%d",
-			 file, lineno);
+		tst_brkm(TBROK | TERRNO, cleanup_fn,
+			 "%s:%d: seteuid(%u) failed",
+			 file, lineno, (unsigned) euid);
 
 	return (rval);
 }
@@ -260,8 +278,9 @@ safe_setgid(const char *file, const int lineno, void (*cleanup_fn) (void),
 
 	rval = setgid(gid);
 	if (rval == -1)
-		tst_brkm(TBROK | TERRNO, cleanup_fn, "setgid failed at %s:%d",
-			 file, lineno);
+		tst_brkm(TBROK | TERRNO, cleanup_fn,
+			 "%s:%d: setgid(%u) failed",
+			 file, lineno, (unsigned) gid);
 
 	return (rval);
 }
@@ -274,8 +293,9 @@ safe_setuid(const char *file, const int lineno, void (*cleanup_fn) (void),
 
 	rval = setuid(uid);
 	if (rval == -1)
-		tst_brkm(TBROK | TERRNO, cleanup_fn, "setuid failed at %s:%d",
-			 file, lineno);
+		tst_brkm(TBROK | TERRNO, cleanup_fn,
+			 "%s:%d: setuid(%u) failed",
+			 file, lineno, (unsigned) uid);
 
 	return (rval);
 }
@@ -288,8 +308,9 @@ safe_unlink(const char *file, const int lineno, void (*cleanup_fn) (void),
 
 	rval = unlink(pathname);
 	if (rval == -1)
-		tst_brkm(TBROK | TERRNO, cleanup_fn, "unlink failed at %s:%d",
-			 file, lineno);
+		tst_brkm(TBROK | TERRNO, cleanup_fn,
+			 "%s:%d: unlink(%s) failed",
+			 file, lineno, pathname);
 
 	return (rval);
 }
@@ -305,8 +326,8 @@ int safe_link(const char *file, const int lineno,
 
 	if (rval == -1) {
 		tst_brkm(TBROK | TERRNO, cleanup_fn,
-		         "link(%s, %s) failed at %s:%d",
-			 oldpath, newpath, file, lineno);
+		         "%s:%d: link(%s, %s) failed",
+			 file, lineno, oldpath, newpath);
 	}
 
 	return rval;
@@ -322,8 +343,8 @@ off_t safe_lseek(const char *file, const int lineno,
 
 	if (rval == (off_t) -1) {
 		tst_brkm(TBROK | TERRNO, cleanup_fn,
-		         "lseek(%i, %li, %i) failed at %s:%d",
-		         fd, (long)offset, whence, file, lineno);
+		         "%s:%d: lseek(%i, %li, %i) failed",
+			 file, lineno, fd, (long)offset, whence);
 	}
 
 	return rval;
@@ -339,8 +360,8 @@ int safe_symlink(const char *file, const int lineno,
 
 	if (rval == -1) {
 		tst_brkm(TBROK | TERRNO, cleanup_fn,
-		         "link(%s, %s) failed at %s:%d",
-			 oldpath, newpath, file, lineno);
+		         "%s:%d: link(%s, %s) failed",
+			 file, lineno, oldpath, newpath);
 	}
 
 	return rval;
@@ -354,8 +375,9 @@ safe_write(const char *file, const int lineno, void (cleanup_fn) (void),
 
 	rval = write(fildes, buf, nbyte);
 	if ((len_strict == 0 && rval == -1) || (size_t)rval != nbyte)
-		tst_brkm(TBROK | TERRNO, cleanup_fn, "write failed at %s:%d",
-			 file, lineno);
+		tst_brkm(TBROK | TERRNO, cleanup_fn,
+			 "%s:%d: write(%d, %p, %zu) failed",
+			file, lineno, fildes, buf, rval);
 
 	return (rval);
 }
@@ -368,7 +390,8 @@ int safe_ftruncate(const char *file, const int lineno,
 	rval = ftruncate(fd, length);
 	if (rval == -1) {
 		tst_brkm(TBROK | TERRNO, cleanup_fn,
-			 "ftruncate failed at %s:%d", file, lineno);
+			 "%s:%d: ftruncate(%d, %ld) failed",
+			 file, lineno, fd, (long) length);
 	}
 
 	return rval;
@@ -381,8 +404,9 @@ int safe_truncate(const char *file, const int lineno,
 
 	rval = truncate(path, length);
 	if (rval == -1) {
-		tst_brkm(TBROK | TERRNO, cleanup_fn, "truncate failed at %s:%d",
-			 file, lineno);
+		tst_brkm(TBROK | TERRNO, cleanup_fn,
+			 "%s:%d: truncate(%s,%ld) failed",
+			 file, lineno, path, length);
 	}
 
 	return rval;
@@ -399,14 +423,14 @@ long safe_strtol(const char *file, const int lineno,
 	if ((errno == ERANGE && (rval == LONG_MAX || rval == LONG_MIN))
 	    || (errno != 0 && rval == 0))
 		tst_brkm(TBROK | TERRNO, cleanup_fn,
-			 "strtol failed at %s:%d", file, lineno);
-	if (rval > max || rval < min)
-		tst_brkm(TBROK, cleanup_fn,
-			 "converted value out of range (%ld - %ld) at %s:%d",
-			 min, max, file, lineno);
+			 "%s:%d: strtol(%s) failed", file, lineno, str);
 	if (endptr == str || (*endptr != '\0' && *endptr != '\n'))
 		tst_brkm(TBROK, cleanup_fn,
-			 "Invalid value: '%s' at %s:%d", str, file, lineno);
+			 "%s:%d: strtol(%s): Invalid value", file, lineno, str);
+	if (rval > max || rval < min)
+		tst_brkm(TBROK, cleanup_fn,
+			 "%s:%d: strtol(%s): converted value %ld is out of range %ld - %ld",
+			 file, lineno, str, rval, min, max);
 
 	return rval;
 }
@@ -423,11 +447,11 @@ unsigned long safe_strtoul(const char *file, const int lineno,
 	if ((errno == ERANGE && rval == ULONG_MAX)
 	    || (errno != 0 && rval == 0))
 		tst_brkm(TBROK | TERRNO, cleanup_fn,
-			 "strtol failed at %s:%d", file, lineno);
+			 "%s:%d: strtoul(%s) failed", file, lineno, str);
 	if (rval > max || rval < min)
 		tst_brkm(TBROK, cleanup_fn,
-			 "converted value out of range (%lu - %lu at %s:%d",
-			 min, max, file, lineno);
+			 "%s:%d: strtoul(%s): converted value %lu is out of range %lu - %lu",
+			 file, lineno, str, rval, min, max);
 	if (endptr == str || (*endptr != '\0' && *endptr != '\n'))
 		tst_brkm(TBROK, cleanup_fn,
 			 "Invalid value: '%s' at %s:%d", str, file, lineno);
@@ -446,11 +470,13 @@ long safe_sysconf(const char *file, const int lineno,
 	if (rval == -1) {
 		if (errno == EINVAL)
 			tst_brkm(TBROK | TERRNO, cleanup_fn,
-				 "sysconf failed at %s:%d", file, lineno);
+				 "%s:%d: sysconf(%d) failed",
+				 file, lineno, name);
 		else
-			tst_resm(TINFO, "queried option is not available"
-				 " or thers is no definite limit at %s:%d",
-				 file, lineno);
+			tst_resm(TINFO, "%s:%d: sysconf(%d): "
+				 "queried option is not available"
+				 " or there is no definite limit",
+				 file, lineno, name);
 	}
 
 	return rval;
@@ -465,7 +491,7 @@ int safe_stat(const char *file, const int lineno,
 
 	if (rval == -1) {
 		tst_brkm(TBROK | TERRNO, cleanup_fn,
-			 "stat failed at %s:%d", file, lineno);
+			 "%s:%d: stat(%s,%p) failed", file, lineno, path, buf);
 	}
 
 	return rval;
@@ -480,7 +506,7 @@ int safe_fstat(const char *file, const int lineno,
 
 	if (rval == -1) {
 		tst_brkm(TBROK | TERRNO, cleanup_fn,
-			 "fstat failed at %s:%d", file, lineno);
+			 "%s:%d: fstat(%d, %p) failed", file, lineno, fd, buf);
 	}
 
 	return rval;
@@ -495,7 +521,7 @@ int safe_lstat(const char *file, const int lineno,
 
 	if (rval == -1) {
 		tst_brkm(TBROK | TERRNO, cleanup_fn,
-			 "lstat failed at %s:%d", file, lineno);
+			 "%s:%d: lstat(%s,%p) failed", file, lineno, path, buf);
 	}
 
 	return rval;
@@ -510,7 +536,8 @@ int safe_getrlimit(const char *file, const int lineno,
 
 	if (rval == -1) {
 		tst_brkm(TBROK | TERRNO, cleanup_fn,
-			 "getrlimit failed at %s:%d", file, lineno);
+			 "%s:%d: getrlimit(%d,%p) failed",
+			 file, lineno, resource, rlim);
 	}
 
 	return rval;
@@ -525,7 +552,8 @@ int safe_setrlimit(const char *file, const int lineno, void (cleanup_fn)(void),
 
 	if (rval == -1) {
 		tst_brkm(TBROK | TERRNO, cleanup_fn,
-			 "setrlimit failed at %s:%d", file, lineno);
+			 "%s:%d: setrlimit(%d,%p) failed",
+			 file, lineno, resource, rlim);
 	}
 
 	return rval;
@@ -540,7 +568,8 @@ int safe_chmod(const char *file, const int lineno,
 
 	if (rval == -1) {
 		tst_brkm(TBROK | TERRNO, cleanup_fn,
-			 "chmod failed at %s:%d", file, lineno);
+			 "%s:%d: chmod(%s,0%o) failed",
+			 file, lineno, path, mode);
 	}
 
 	return rval;
@@ -555,7 +584,8 @@ int safe_fchmod(const char *file, const int lineno,
 
 	if (rval == -1) {
 		tst_brkm(TBROK | TERRNO, cleanup_fn,
-			 "fchmod failed at %s:%d", file, lineno);
+			 "%s:%d: fchmod(%d,0%o) failed",
+			 file, lineno, fd, mode);
 	}
 
 	return rval;
-- 
1.7.10.4


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [LTP] [PATCH] Make SAFE_* calls more informative when failing
  2014-04-16 17:27 ` [LTP] [PATCH] Make SAFE_* calls more informative when failing Mats Liljegren
  2014-04-16 17:27   ` Mats Liljegren
@ 2014-04-22 13:24   ` Mats Liljegren
  2014-04-22 13:42     ` chrubis
  1 sibling, 1 reply; 7+ messages in thread
From: Mats Liljegren @ 2014-04-22 13:24 UTC (permalink / raw)
  To: ltp-list

On Wed, 16 Apr 2014 19:27:57 +0200
Mats Liljegren <mats.liljegren@enea.com> wrote:

> 
> When debugging failing test cases I often missed what parameters were
> used in those SAFE_* calls. This patch is meant to fix this.
> 
> The output has been "standardized" into the following format:
> <file>:<line>: <func>(<params>) <error message>
> 
> E.g.:
> test.c:130: chdir(mydir) failed
> 
> This will then be followed by the usual errno stuff if applicable.
> 
> The code compiles, but I haven't figured out a good way of testing
> it. The changes are pretty simple however.
> 
> Regards
> Mats Liljegren

I guess the lack of response on this patch was due to stabilization, but
now that we have a release I'd like to remind about this one...

Regards
Mats Liljegren

------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [LTP] [PATCH] Make SAFE_* calls more informative when failing
  2014-04-16 17:27   ` Mats Liljegren
@ 2014-04-22 13:41     ` chrubis
  0 siblings, 0 replies; 7+ messages in thread
From: chrubis @ 2014-04-22 13:41 UTC (permalink / raw)
  To: Mats Liljegren; +Cc: ltp-list

Hi!
> The output has been "standardized" into the following format:
> <file>:<line>: <func>(<params>) <error message>
> 
> E.g.:
> test.c:130: chdir(mydir) failed
> 
> This will then be followed by the usual errno stuff if applicable.

I've also unified conding style for the file and fixed a minor things
(use octal instead of decimal for creat() mode, the symlink error
message said link() instead of symlink(), etc.) and pushed these an one
commit, thanks.

PS: I've also decided to print open() mode regardless if it's used or
    not, which is IMHO better than not printing it at all.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [LTP] [PATCH] Make SAFE_* calls more informative when failing
  2014-04-22 13:24   ` Mats Liljegren
@ 2014-04-22 13:42     ` chrubis
  0 siblings, 0 replies; 7+ messages in thread
From: chrubis @ 2014-04-22 13:42 UTC (permalink / raw)
  To: Mats Liljegren; +Cc: ltp-list

Hi!
> I guess the lack of response on this patch was due to stabilization, but

Right.

> now that we have a release I'd like to remind about this one...

Allready in ;).

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-04-22 13:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-16  7:15 [LTP] More informative error messages from SAFE_*? Mats Liljegren
2014-04-16 15:52 ` chrubis
2014-04-16 17:27 ` [LTP] [PATCH] Make SAFE_* calls more informative when failing Mats Liljegren
2014-04-16 17:27   ` Mats Liljegren
2014-04-22 13:41     ` chrubis
2014-04-22 13:24   ` Mats Liljegren
2014-04-22 13:42     ` chrubis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.