public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* [PATCH][MSP430] Fix return code error in simulator implemenations of write.c.
@ 2017-05-26  7:50 Martin Young
  2017-05-26 10:37 ` Nick Clifton
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Young @ 2017-05-26  7:50 UTC (permalink / raw)
  To: newlib

[-- Attachment #1: Type: text/plain, Size: 420 bytes --]

Hello,

In the MSP430 simulator implementation of write() in write.c the wrong
local is used as the return code (it's returning the result of the
last invocation of write_chunk() (variable c) rather than the
aggregate write size (variable rv). This causes issues for users of
write().

Patch included as attachment to avoid whitespace issues.

I do do not have the ability to apply patch this myself.

Regards,
-Martin.

[-- Attachment #2: rc.patch --]
[-- Type: application/octet-stream, Size: 687 bytes --]

From 597e1725a807b0025b774a63b798734c9e2102f0 Mon Sep 17 00:00:00 2001
From: Martin <martin.y@somniumtech.com>
Date: Wed, 1 Mar 2017 10:07:40 +0000
Subject: [PATCH] Fix return code error in simulator implemenations of write.c.
 Case #5073

---
 newlib.subtree/libgloss/msp430/write.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/newlib.subtree/libgloss/msp430/write.c b/newlib.subtree/libgloss/msp430/write.c
index 0c01098..3a5a9f8 100644
--- a/newlib.subtree/libgloss/msp430/write.c
+++ b/newlib.subtree/libgloss/msp430/write.c
@@ -55,5 +55,5 @@ write (int fd, char *buf, int len)
       len -= l;
       buf += l;
     }
-  return c;
+  return rv;
 }
-- 
2.9.3


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

* Re: [PATCH][MSP430] Fix return code error in simulator implemenations of write.c.
  2017-05-26  7:50 [PATCH][MSP430] Fix return code error in simulator implemenations of write.c Martin Young
@ 2017-05-26 10:37 ` Nick Clifton
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Clifton @ 2017-05-26 10:37 UTC (permalink / raw)
  To: Martin Young, newlib

Hi Martin,

> In the MSP430 simulator implementation of write() in write.c the wrong
> local is used as the return code (it's returning the result of the
> last invocation of write_chunk() (variable c) rather than the
> aggregate write size (variable rv). This causes issues for users of
> write().
> 
> Patch included as attachment to avoid whitespace issues.

Thanks very much for reporting this problem, and for providing a fix.
I have checked your patch in, so the write() function should work
properly from now on.

Cheers
  Nick


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

end of thread, other threads:[~2017-05-26 10:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-26  7:50 [PATCH][MSP430] Fix return code error in simulator implemenations of write.c Martin Young
2017-05-26 10:37 ` Nick Clifton

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 read-only IMAP folder(s) and NNTP newsgroup(s).