X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/642855f81fd03b9fd6540ac99c665b57b4b38cc8..f13e160f6aa2f74895ecf1f65099265643836210:/lunaix-os/kernel/demos/iotest.c?ds=sidebyside diff --git a/lunaix-os/kernel/demos/iotest.c b/lunaix-os/kernel/demos/iotest.c index cba8962..91c3571 100644 --- a/lunaix-os/kernel/demos/iotest.c +++ b/lunaix-os/kernel/demos/iotest.c @@ -1,8 +1,8 @@ -#include -#include -#include -#include #include +#include +#include +#include +#include void _iotest_main() @@ -13,8 +13,8 @@ _iotest_main() char read_out[256]; // 切换工作目录至 /dev - int errno = chdir("/dev"); - if (errno) { + int status = chdir("/dev"); + if (status) { write(stdout, "fail to chdir", 15); return; } @@ -29,7 +29,7 @@ _iotest_main() int fd = open("./sda", 0); if (fd < 0) { - printf("fail to open (%d)\n", geterrno()); + printf("fail to open (%d)\n", errno); return; }