mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] console: return number of characters written in fops_write
@ 2019-08-05  9:15 Sascha Hauer
  0 siblings, 0 replies; only message in thread
From: Sascha Hauer @ 2019-08-05  9:15 UTC (permalink / raw)
  To: Barebox List

struct cdev_operations write() callback is supposed to return the number
of characters written. Do this instead of returning 0 for the console
device files.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 common/console.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/console.c b/common/console.c
index 406722a1da..ee17a508ba 100644
--- a/common/console.c
+++ b/common/console.c
@@ -300,7 +300,7 @@ static ssize_t fops_write(struct cdev* dev, const void* buf, size_t count,
 
 	priv->puts(priv, buf);
 
-	return 0;
+	return count;
 }
 
 int console_register(struct console_device *newcdev)
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-08-05  9:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-05  9:15 [PATCH] console: return number of characters written in fops_write Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox