Commit 168bc9f1 authored by Daniel Verkamp's avatar Daniel Verkamp Committed by Jim Harris
Browse files

blobcli: exit shell when EOF is encountered



Change-Id: I660c2b37b22b4a60b6ebcd77ade475072a6a05a7
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/398079


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 7fc14171
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1296,6 +1296,13 @@ cli_shell(void *arg1, void *arg2)
	printf("blob> ");
	bytes_in = getline(&line, &buf_size, stdin);

	/* If getline() failed (EOF), exit the shell. */
	if (bytes_in < 0) {
		free(line);
		cli_context->action = CLI_SHELL_EXIT;
		return true;
	}

	/* parse input and update cli_context so we can use common option parser */
	if (bytes_in > 0) {
		tok = strtok(line, " ");