aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/main.c b/main.c
index 8d18640..8e0e97b 100644
--- a/main.c
+++ b/main.c
@@ -181,10 +181,14 @@ int main(void) {
int (*func)(struct string source, uint64_t argc, struct string *argv) = get_table_index(network_commands, command);
if (func == 0) {
- WRITES(1, STRING("WARNING: Command is unknown, ignoring...\n"));
+ WRITES(2, STRING("WARNING: Command is unknown, ignoring...\n"));
} else {
write(1, "\n", 1);
- func(source, argc, argv);
+ int err = func(source, argc, argv);
+ if (err) {
+ WRITES(1, STRING("Disconnecting by result of the network command handler...\n"));
+ return 0;
+ }
}
write(1, "\n", 1);