git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
5-malloc.md (#25)
[lunaix-os.git]
/
lunaix-os
/
kernel
/
fs
/
vfs.c
diff --git
a/lunaix-os/kernel/fs/vfs.c
b/lunaix-os/kernel/fs/vfs.c
index 80d2036b88ab8657e48fa45ab96ab566d3b7f256..c59584ac57b51b4dea0c53660d5ebb589d2d7134 100644
(file)
--- a/
lunaix-os/kernel/fs/vfs.c
+++ b/
lunaix-os/kernel/fs/vfs.c
@@
-860,7
+860,7
@@
vfs_readlink(struct v_dnode* dnode, char* buf, size_t size)
int
vfs_get_dtype(int itype)
{
int
vfs_get_dtype(int itype)
{
- if ((itype & VFS_IFSYMLINK)) {
+ if ((itype & VFS_IFSYMLINK)
== VFS_IFSYMLINK
) {
return DT_SYMLINK;
} else if (!(itype & VFS_IFFILE)) {
return DT_DIR;
return DT_SYMLINK;
} else if (!(itype & VFS_IFFILE)) {
return DT_DIR;
@@
-1003,6
+1003,11
@@
__DEFINE_LXSYSCALL1(int, mkdir, const char*, path)
goto done;
}
goto done;
}
+ if (!(errno = vfs_walk(parent, name_value, &dir, NULL, 0))) {
+ errno = EEXIST;
+ goto done;
+ }
+
if ((errno = vfs_check_writable(parent))) {
goto done;
}
if ((errno = vfs_check_writable(parent))) {
goto done;
}
@@
-1332,7
+1337,7
@@
__DEFINE_LXSYSCALL2(char*, getcwd, char*, buf, size_t, size)
ret_ptr = buf;
done:
ret_ptr = buf;
done:
-
__current->k_status = errno
;
+
syscall_result(errno)
;
return ret_ptr;
}
return ret_ptr;
}