diff mbox

[2/1] error: Copy location information in error_copy()

Message ID 1441902890-23064-1-git-send-email-eblake@redhat.com
State New
Headers show

Commit Message

Eric Blake Sept. 10, 2015, 4:34 p.m. UTC
Commit 1e9b65bb forgot to propagate source information to copied
errors.

Signed-off-by: Eric Blake <eblake@redhat.com>
---

I noticed this while rebasing my patch (as in 'why did I not
get a merge conflict where I expected one?'); of course we
could apply this one first, but swapping the patch order implies
even more rebasing :)

 util/error.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Markus Armbruster Sept. 10, 2015, 6:06 p.m. UTC | #1
Eric Blake <eblake@redhat.com> writes:

> Commit 1e9b65bb forgot to propagate source information to copied
> errors.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
>
> I noticed this while rebasing my patch (as in 'why did I not
> get a merge conflict where I expected one?'); of course we
> could apply this one first, but swapping the patch order implies
> even more rebasing :)
>
>  util/error.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/util/error.c b/util/error.c
> index 9dd474f..b1eb8a2 100644
> --- a/util/error.c
> +++ b/util/error.c
> @@ -174,6 +174,9 @@ Error *error_copy(const Error *err)
>      err_new = g_malloc0(sizeof(*err));
>      err_new->msg = g_strdup(err->msg);
>      err_new->err_class = err->err_class;
> +    err_new->src = err->src;
> +    err_new->line = err->line;
> +    err_new->func = err->func;
>      if (err->hint) {
>          err_new->hint = g_string_new(err->hint->str);
>      }

Escaped review, but not for long :)

I'll take this through my tree.  Thanks!
diff mbox

Patch

diff --git a/util/error.c b/util/error.c
index 9dd474f..b1eb8a2 100644
--- a/util/error.c
+++ b/util/error.c
@@ -174,6 +174,9 @@  Error *error_copy(const Error *err)
     err_new = g_malloc0(sizeof(*err));
     err_new->msg = g_strdup(err->msg);
     err_new->err_class = err->err_class;
+    err_new->src = err->src;
+    err_new->line = err->line;
+    err_new->func = err->func;
     if (err->hint) {
         err_new->hint = g_string_new(err->hint->str);
     }