mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] fixup! restart: give all restart handlers a descriptive name
Date: Tue, 15 Sep 2020 14:05:41 +0200	[thread overview]
Message-ID: <20200915120541.22508-1-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20200602075757.4734-2-a.fatoum@pengutronix.de>

As suggested by Sascha, allow users to pass automatically allocated
name.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 common/restart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/restart.c b/common/restart.c
index 3791337a7505..7bd39de8c318 100644
--- a/common/restart.c
+++ b/common/restart.c
@@ -64,7 +64,7 @@ int restart_handler_register_fn(const char *name,
 
 	rst = xzalloc(sizeof(*rst));
 
-	rst->name = name;
+	rst->name = xstrdup(name);
 	rst->restart = restart_fn;
 
 	ret = restart_handler_register(rst);
-- 
2.28.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2020-09-15 12:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-02  7:57 [PATCH 1/3] common: restart: number unnamed restart handlers Ahmad Fatoum
2020-06-02  7:57 ` [PATCH 2/3] restart: give all restart handlers a descriptive name Ahmad Fatoum
2020-06-03  7:12   ` Sascha Hauer
2020-09-15 12:05   ` Ahmad Fatoum [this message]
2020-06-02  7:57 ` [PATCH 3/3] commands: reset: allow specifying reset by name Ahmad Fatoum
2020-06-03  7:11 ` [PATCH 1/3] common: restart: number unnamed restart handlers Sascha Hauer
2020-06-03 13:32   ` Ahmad Fatoum
2020-06-08  5:20     ` Sascha Hauer
2020-09-15  8:48       ` Ahmad Fatoum
2020-09-15 12:32         ` Sascha Hauer

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=20200915120541.22508-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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