Skip to content

Commit

Permalink
Merge pull request #47 from chaos4ever/feature/make-cluido-wait-for-s…
Browse files Browse the repository at this point in the history
…ervers-to-become-available

Make cluido wait for ipv4 to become available
  • Loading branch information
perlun committed Aug 27, 2015
2 parents 2f10ad2 + f618765 commit d1985f1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion libraries/ipv4/ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ return_type ipv4_init(ipc_structure_type *ipv4_structure, tag_type *tag)
unsigned int services = 10;

// Try to resolve the IPv4 service.
if (ipc_service_resolve("ipv4", mailbox_id, &services, 0, tag) != IPC_RETURN_SUCCESS)
if (ipc_service_resolve("ipv4", mailbox_id, &services, 5, tag) != IPC_RETURN_SUCCESS)
{
return IPV4_RETURN_SERVICE_UNAVAILABLE;
}
Expand Down
12 changes: 12 additions & 0 deletions programs/cluido/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ int number_of_commands = (sizeof(command) / sizeof(command_type));
// Show the entries in the ARP table.
void command_arp(int number_of_arguments UNUSED, char **argument UNUSED)
{
if (!has_net)
{
console_print_formatted(&console_structure, "\nNetworking is not available. Is the 'ipv4' server running?\n\n");
return;
}

message_parameter_type message_parameter;
int amount;
int counter;
Expand Down Expand Up @@ -488,6 +494,12 @@ void command_help(int number_of_arguments, char **argument)
// Configure IP networking.
void command_ip(int number_of_arguments, char **argument)
{
if (!has_net)
{
console_print_formatted(&console_structure, "\nNetworking is not available. Is the 'ipv4' server running?\n\n");
return;
}

// If no arguments are given, print information about the current interfaces.
if (number_of_arguments == 1)
{
Expand Down
6 changes: 3 additions & 3 deletions programs/cluido/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ int main(void)
return -1;
}

// We may be running as a "service" until the boot server has been fixed, so for now, let's unblock the next server.
system_call_process_parent_unblock();

file_init(&vfs_structure, &empty_tag);
memory_init();

Expand Down Expand Up @@ -83,9 +86,6 @@ Some Emacs compatible bindings (C-a, C-e, etc) are available, and also some\n\
DOS:ish ones (Home, End, arrows). You can go back and forth in the command\n\
history with the up and down arrows.\n\n");

// We may be running as a "service" until the boot server has been fixed, so for now, let's unblock the next server.
system_call_process_parent_unblock();

main_loop();
return 0;
}

0 comments on commit d1985f1

Please sign in to comment.