From: Daniel Jacobowitz <drow@false.org>
To: Pedro Alves <pedro_alves@portugalmail.pt>
Cc: GDB Patches <gdb-patches@sourceware.org>
Subject: Re: [gdbserver] Make mingw32ce gdbserver build again
Date: Thu, 31 Jan 2008 15:02:00 -0000 [thread overview]
Message-ID: <20080131145513.GA32620@caradoc.them.org> (raw)
In-Reply-To: <47A138D6.5090108@portugalmail.pt>
On Thu, Jan 31, 2008 at 02:56:22AM +0000, Pedro Alves wrote:
> static void
> -hostio_error (char *own_buf, int error)
> +hostio_error (char *own_buf)
> {
> - int fileio_error = errno_to_fileio_errno (error);
> -
> - sprintf (own_buf, "F-1,%x", fileio_error);
> + sprintf (own_buf, "F-1,");
> + the_target->hostio_last_error (own_buf + 4);
> }
>
Pretty much anything can change errno. That includes sprintf. So you
have to save the value of errno before you call back into the C
library, in general, or you might print some other error than the one
you want.
For now, how about the_target->hostio_last_error which converts to a
protocol error and returns that? Then we can call it before sprintf.
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2008-01-31 14:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-31 7:03 Pedro Alves
2008-01-31 15:02 ` Daniel Jacobowitz [this message]
2008-01-31 18:45 ` Pedro Alves
2008-01-31 22:03 ` Daniel Jacobowitz
2008-02-01 0:14 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080131145513.GA32620@caradoc.them.org \
--to=drow@false.org \
--cc=gdb-patches@sourceware.org \
--cc=pedro_alves@portugalmail.pt \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox