igt-dev.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] lib/igt_sysfs: Return errno from igt_sysfs_printf
@ 2018-08-29 13:13 Katarzyna Dec
  2018-08-29 13:22 ` Chris Wilson
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Katarzyna Dec @ 2018-08-29 13:13 UTC (permalink / raw)
  To: igt-dev

Let's add returning errno on failure instead of -1.

Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
---
 lib/igt_sysfs.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/igt_sysfs.c b/lib/igt_sysfs.c
index 8efe889b..6cc7ba44 100644
--- a/lib/igt_sysfs.c
+++ b/lib/igt_sysfs.c
@@ -417,7 +417,7 @@ int igt_sysfs_vprintf(int dir, const char *attr, const char *fmt, va_list ap)
  * printf() wrapper for sysfs.
  *
  * Returns:
- * Number of characters written, negative value on error.
+ * Number of characters written, errno on error.
  */
 int igt_sysfs_printf(int dir, const char *attr, const char *fmt, ...)
 {
@@ -427,6 +427,8 @@ int igt_sysfs_printf(int dir, const char *attr, const char *fmt, ...)
 	va_start(ap, fmt);
 	ret = igt_sysfs_vprintf(dir, attr, fmt, ap);
 	va_end(ap);
+	if (ret < 0)
+		return errno;
 
 	return ret;
 }
-- 
2.17.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2018-08-30  8:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-29 13:13 [igt-dev] [PATCH i-g-t] lib/igt_sysfs: Return errno from igt_sysfs_printf Katarzyna Dec
2018-08-29 13:22 ` Chris Wilson
2018-08-30  8:12   ` Katarzyna Dec
2018-08-30  8:08 ` [igt-dev] ✓ Fi.CI.IGT: success for " Patchwork
2018-08-30  8:23 ` [igt-dev] ✓ Fi.CI.BAT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).