aboutsummaryrefslogtreecommitdiff
path: root/src/openrc-run
diff options
context:
space:
mode:
Diffstat (limited to 'src/openrc-run')
-rw-r--r--src/openrc-run/openrc-run.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/openrc-run/openrc-run.c b/src/openrc-run/openrc-run.c
index 0ede04a6..2b1d3746 100644
--- a/src/openrc-run/openrc-run.c
+++ b/src/openrc-run/openrc-run.c
@@ -108,7 +108,7 @@ static void
handle_signal(int sig)
{
int serrno = errno;
- char *signame = NULL;
+ const char *signame = NULL;
struct winsize ws;
switch (sig) {
@@ -134,20 +134,19 @@ handle_signal(int sig)
case SIGINT:
if (!signame)
- xasprintf(&signame, "SIGINT");
+ signame = "SIGINT";
/* FALLTHROUGH */
case SIGTERM:
if (!signame)
- xasprintf(&signame, "SIGTERM");
+ signame = "SIGTERM";
/* FALLTHROUGH */
case SIGQUIT:
if (!signame)
- xasprintf(&signame, "SIGQUIT");
+ signame = "SIGQUIT";
/* Send the signal to our children too */
if (service_pid > 0)
kill(service_pid, sig);
eerror("%s: caught %s, aborting", applet, signame);
- free(signame);
exit(EXIT_FAILURE);
/* NOTREACHED */