MINOR: mworker/cli: indicate in the master prompt when a reload failed

If a reload was issued to the master process and failed, it is critical
that the admin sees it because it means that the saved configuration
does not work anymore and might not be usable after a full restart. For
this reason in this case we modify the "master" prompt to explicitly
indicate that a reload failed.
diff --git a/doc/management.txt b/doc/management.txt
index ff98b74..21719f4 100644
--- a/doc/management.txt
+++ b/doc/management.txt
@@ -2538,6 +2538,13 @@
 worker is still running and survived 3 reloads. You could access the CLI of
 this worker to understand what's going on.
 
+When the prompt is enabled (via the "prompt" command), the context the CLI is
+working on is displayed in the prompt. The master is identified by the "master"
+string, and other processes are identified with their PID. In case the last
+reload failed, the master prompt will be changed to "master[ReloadFailed]>" so
+that it becomes visible that the process is still running on the previous
+configuration and that the new configuration is not operational.
+
 The master CLI uses a special prefix notation to access the multiple
 processes. This notation is easily identifiable as it begins by a @.
 
diff --git a/src/cli.c b/src/cli.c
index d75955d..1a2253c 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -1718,7 +1718,8 @@
 		chunk_appendf(msg, "+ ");
 	} else {
 		if (s->pcli_next_pid == 0)
-			chunk_appendf(msg, "master> ");
+			chunk_appendf(msg, "master%s> ",
+			              (global.mode & MODE_MWORKER_WAIT) ? "[ReloadFailed]" : "");
 		else
 			chunk_appendf(msg, "%d> ", s->pcli_next_pid);
 	}