Skip to content

Commit

Permalink
lpc-test v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
oiuv committed Apr 18, 2019
1 parent 97b0751 commit 6069371
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
4 changes: 3 additions & 1 deletion cmds/shutdown.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ int main(object me, string arg)
{
shutdown(0);
return 1;
} else {
}
else
{
return 0;
}
}
7 changes: 4 additions & 3 deletions cmds/update.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ int main(object me, string file)
{
object ob, env = environment(me);

if(!wizardp(me))
if (!wizardp(me))
{
return 0;
}
Expand All @@ -14,7 +14,7 @@ int main(object me, string file)

if (file == "here")
{
if(env)
if (env)
file = file_name(env);
else
return notify_fail("你不在任何环境中。\n");
Expand All @@ -35,7 +35,8 @@ int main(object me, string file)
if (objectp(load_object(file)))
{
write("成功!\n");
} else
}
else
{
write("失败!\n");
}
Expand Down
1 change: 1 addition & 0 deletions include/globals.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* 所有对象加载时都会自动包含本文件
*/

#define LOGIN_OB "/system/object/login_ob"
#define VOID_OB "/system/object/void_ob"
3 changes: 1 addition & 2 deletions system/kernel/master.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ string get_root_uid()
return "ROOT";
}


string author_file(string str)
{
return str;
Expand All @@ -21,7 +20,7 @@ string domain_file(string str)

object connect(int port)
{
return new(LOGIN_OB);
return new (LOGIN_OB);
}

string creator_file(string str)
Expand Down
7 changes: 5 additions & 2 deletions system/object/login_ob.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ int command_hook(string arg)
cmd = CMD_PATH + query_verb();

cmd_ob = load_object(cmd);
if (cmd_ob) {
if (cmd_ob)
{
return (int)cmd_ob->main(this_object(), arg);
} else {
}
else
{
return notify_fail("指令不存在 T_T\n");
}
}

0 comments on commit 6069371

Please sign in to comment.