From dbbca37d38772f0f75296b01b757225278eb51fc Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 17 Dec 2013 21:39:11 -0700 Subject: [PATCH] Add target_ops argument to to_fileio_unlink 2014-02-19 Tom Tromey * target.h (struct target_ops) : Add argument. * target.c (target_fileio_unlink): Add argument. * remote.c (remote_hostio_unlink): Add 'self' argument. (remote_file_delete): Update. * inf-child.c (inf_child_fileio_unlink): Add 'self' argument. --- gdb/ChangeLog | 8 ++++++++ gdb/inf-child.c | 3 ++- gdb/remote.c | 6 ++++-- gdb/target.c | 2 +- gdb/target.h | 3 ++- 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index fb75b1a6f4..24d3b34dcf 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2014-02-19 Tom Tromey + + * target.h (struct target_ops) : Add argument. + * target.c (target_fileio_unlink): Add argument. + * remote.c (remote_hostio_unlink): Add 'self' argument. + (remote_file_delete): Update. + * inf-child.c (inf_child_fileio_unlink): Add 'self' argument. + 2014-02-19 Tom Tromey * target.h (struct target_ops) : Add argument. diff --git a/gdb/inf-child.c b/gdb/inf-child.c index 01bf1af7a6..eb7550a9c6 100644 --- a/gdb/inf-child.c +++ b/gdb/inf-child.c @@ -328,7 +328,8 @@ inf_child_fileio_close (struct target_ops *self, int fd, int *target_errno) /* Unlink FILENAME on the target. Return 0, or -1 if an error occurs (and set *TARGET_ERRNO). */ static int -inf_child_fileio_unlink (const char *filename, int *target_errno) +inf_child_fileio_unlink (struct target_ops *self, + const char *filename, int *target_errno) { int ret; diff --git a/gdb/remote.c b/gdb/remote.c index 19bef54c1c..cf8870edbf 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -9770,7 +9770,8 @@ remote_hostio_close (struct target_ops *self, int fd, int *remote_errno) occurs (and set *REMOTE_ERRNO). */ static int -remote_hostio_unlink (const char *filename, int *remote_errno) +remote_hostio_unlink (struct target_ops *self, + const char *filename, int *remote_errno) { struct remote_state *rs = get_remote_state (); char *p = rs->buf; @@ -10152,7 +10153,8 @@ remote_file_delete (const char *remote_file, int from_tty) if (!rs->remote_desc) error (_("command can only be used with remote target")); - retcode = remote_hostio_unlink (remote_file, &remote_errno); + retcode = remote_hostio_unlink (find_target_at (process_stratum), + remote_file, &remote_errno); if (retcode == -1) remote_hostio_error (remote_errno); diff --git a/gdb/target.c b/gdb/target.c index 8767b57239..2c4b6b658c 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -3483,7 +3483,7 @@ target_fileio_unlink (const char *filename, int *target_errno) { if (t->to_fileio_unlink != NULL) { - int ret = t->to_fileio_unlink (filename, target_errno); + int ret = t->to_fileio_unlink (t, filename, target_errno); if (targetdebug) fprintf_unfiltered (gdb_stdlog, diff --git a/gdb/target.h b/gdb/target.h index e2dddc71cf..5d5802ef09 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -740,7 +740,8 @@ struct target_ops /* Unlink FILENAME on the target. Return 0, or -1 if an error occurs (and set *TARGET_ERRNO). */ - int (*to_fileio_unlink) (const char *filename, int *target_errno); + int (*to_fileio_unlink) (struct target_ops *, + const char *filename, int *target_errno); /* Read value of symbolic link FILENAME on the target. Return a null-terminated string allocated via xmalloc, or NULL if an error -- 2.34.1