Add target_ops argument to to_fileio_close
2014-02-19 Tom Tromey <tromey@redhat.com> * target.h (struct target_ops) <to_fileio_close>: Add argument. * target.c (target_fileio_close): Add argument. * remote.c (remote_hostio_close): Add 'self' argument. (remote_hostio_close_cleanup): Update. (remote_bfd_iovec_close, remote_file_put, remote_file_get): Update. * inf-child.c (inf_child_fileio_close): Add 'self' argument.
This commit is contained in:
parent
a3be983cee
commit
df39ea259c
5 changed files with 18 additions and 8 deletions
|
@ -1,3 +1,13 @@
|
||||||
|
2014-02-19 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
|
* target.h (struct target_ops) <to_fileio_close>: Add argument.
|
||||||
|
* target.c (target_fileio_close): Add argument.
|
||||||
|
* remote.c (remote_hostio_close): Add 'self' argument.
|
||||||
|
(remote_hostio_close_cleanup): Update.
|
||||||
|
(remote_bfd_iovec_close, remote_file_put, remote_file_get):
|
||||||
|
Update.
|
||||||
|
* inf-child.c (inf_child_fileio_close): Add 'self' argument.
|
||||||
|
|
||||||
2014-02-19 Tom Tromey <tromey@redhat.com>
|
2014-02-19 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
* target.h (struct target_ops) <to_fileio_pread>: Add argument.
|
* target.h (struct target_ops) <to_fileio_pread>: Add argument.
|
||||||
|
|
|
@ -314,7 +314,7 @@ inf_child_fileio_pread (struct target_ops *self,
|
||||||
/* Close FD on the target. Return 0, or -1 if an error occurs
|
/* Close FD on the target. Return 0, or -1 if an error occurs
|
||||||
(and set *TARGET_ERRNO). */
|
(and set *TARGET_ERRNO). */
|
||||||
static int
|
static int
|
||||||
inf_child_fileio_close (int fd, int *target_errno)
|
inf_child_fileio_close (struct target_ops *self, int fd, int *target_errno)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
|
10
gdb/remote.c
10
gdb/remote.c
|
@ -9752,7 +9752,7 @@ remote_hostio_pread (struct target_ops *self,
|
||||||
(and set *REMOTE_ERRNO). */
|
(and set *REMOTE_ERRNO). */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
remote_hostio_close (int fd, int *remote_errno)
|
remote_hostio_close (struct target_ops *self, int fd, int *remote_errno)
|
||||||
{
|
{
|
||||||
struct remote_state *rs = get_remote_state ();
|
struct remote_state *rs = get_remote_state ();
|
||||||
char *p = rs->buf;
|
char *p = rs->buf;
|
||||||
|
@ -9891,7 +9891,7 @@ remote_hostio_close_cleanup (void *opaque)
|
||||||
int fd = *(int *) opaque;
|
int fd = *(int *) opaque;
|
||||||
int remote_errno;
|
int remote_errno;
|
||||||
|
|
||||||
remote_hostio_close (fd, &remote_errno);
|
remote_hostio_close (find_target_at (process_stratum), fd, &remote_errno);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -9928,7 +9928,7 @@ remote_bfd_iovec_close (struct bfd *abfd, void *stream)
|
||||||
|
|
||||||
/* Ignore errors on close; these may happen if the remote
|
/* Ignore errors on close; these may happen if the remote
|
||||||
connection was already torn down. */
|
connection was already torn down. */
|
||||||
remote_hostio_close (fd, &remote_errno);
|
remote_hostio_close (find_target_at (process_stratum), fd, &remote_errno);
|
||||||
|
|
||||||
/* Zero means success. */
|
/* Zero means success. */
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -10077,7 +10077,7 @@ remote_file_put (const char *local_file, const char *remote_file, int from_tty)
|
||||||
}
|
}
|
||||||
|
|
||||||
discard_cleanups (close_cleanup);
|
discard_cleanups (close_cleanup);
|
||||||
if (remote_hostio_close (fd, &remote_errno))
|
if (remote_hostio_close (find_target_at (process_stratum), fd, &remote_errno))
|
||||||
remote_hostio_error (remote_errno);
|
remote_hostio_error (remote_errno);
|
||||||
|
|
||||||
if (from_tty)
|
if (from_tty)
|
||||||
|
@ -10135,7 +10135,7 @@ remote_file_get (const char *remote_file, const char *local_file, int from_tty)
|
||||||
}
|
}
|
||||||
|
|
||||||
discard_cleanups (close_cleanup);
|
discard_cleanups (close_cleanup);
|
||||||
if (remote_hostio_close (fd, &remote_errno))
|
if (remote_hostio_close (find_target_at (process_stratum), fd, &remote_errno))
|
||||||
remote_hostio_error (remote_errno);
|
remote_hostio_error (remote_errno);
|
||||||
|
|
||||||
if (from_tty)
|
if (from_tty)
|
||||||
|
|
|
@ -3458,7 +3458,7 @@ target_fileio_close (int fd, int *target_errno)
|
||||||
{
|
{
|
||||||
if (t->to_fileio_close != NULL)
|
if (t->to_fileio_close != NULL)
|
||||||
{
|
{
|
||||||
int ret = t->to_fileio_close (fd, target_errno);
|
int ret = t->to_fileio_close (t, fd, target_errno);
|
||||||
|
|
||||||
if (targetdebug)
|
if (targetdebug)
|
||||||
fprintf_unfiltered (gdb_stdlog,
|
fprintf_unfiltered (gdb_stdlog,
|
||||||
|
|
|
@ -736,7 +736,7 @@ struct target_ops
|
||||||
|
|
||||||
/* Close FD on the target. Return 0, or -1 if an error occurs
|
/* Close FD on the target. Return 0, or -1 if an error occurs
|
||||||
(and set *TARGET_ERRNO). */
|
(and set *TARGET_ERRNO). */
|
||||||
int (*to_fileio_close) (int fd, int *target_errno);
|
int (*to_fileio_close) (struct target_ops *, int fd, int *target_errno);
|
||||||
|
|
||||||
/* Unlink FILENAME on the target. Return 0, or -1 if an error
|
/* Unlink FILENAME on the target. Return 0, or -1 if an error
|
||||||
occurs (and set *TARGET_ERRNO). */
|
occurs (and set *TARGET_ERRNO). */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue