rem: reply_to_external_command(result);
add: reply_to_external_command(to_platform_error(result));
context: do_fsh(void){#if 0	char stack_filler[1024 * 1024 * 16 - 32 * 1024];		// actually emulating 12kB stack size (BeOS has 16 MB - ~20kB for the main thread)#endif    int   argc, len;    char *prompt = FS_SHELL_PROMPT ">> ";    char  input[1024], **argv;    cmd_entry *cmd = NULL;    while(getline(prompt, input, sizeof(input)) != NULL) {        argc = 0;        argv = build_argv(input, &argc);        if (argv == NULL || argc == 0) {            continue;        }        len = strlen(&argv[0][0]);	    for (cmd_entry **commands = fsh_commands; *commands; commands++) {		    cmd_entry *cmd = *commands;		    for (; cmd->name != NULL; cmd++) {	            if (strncmp(cmd->name, &argv[0][0], len) == 0) {	                int result = cmd->func(argc, argv);						if (!sInteractiveMode)						reply_to_external_command(result);		                break;	            }	        }	    }                if (strncmp(&argv[0][0], "quit", 4) == 0            || strncmp(&argv[0][0], "exit", 4) == 0) {			if (!sInteractiveMode)				reply_to_external_command(0);            break;        }        if (cmd->name == NULL && argv[0][0] != '\0') {            printf("command `%s' not understood\n", &argv[0][0]);			if (!sInteractiveMode)				reply_to_external_command(EINVAL);        }                free(argv);    }    if (feof(stdin))        printf("\n");    if (cur_fd != -1)        do_close(0, NULL);}