Correct errno return in link() function (bug #8770)
* edited as pointed by Axel
This commit is contained in:
committed by
Jerome Duval
parent
4280f862ec
commit
89b48debc2
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2009, Axel Dörfler, [email protected].
|
* Copyright 2002-2013, Axel Dörfler, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -76,7 +76,12 @@ unlinkat(int fd, const char *path, int flag)
|
|||||||
int
|
int
|
||||||
link(const char *toPath, const char *linkPath)
|
link(const char *toPath, const char *linkPath)
|
||||||
{
|
{
|
||||||
RETURN_AND_SET_ERRNO(_kern_create_link(-1, linkPath, -1, toPath, true));
|
int status = _kern_create_link(-1, linkPath, -1, toPath, true);
|
||||||
|
// Haiku -> POSIX error mapping
|
||||||
|
if (status == B_UNSUPPORTED)
|
||||||
|
status = EPERM;
|
||||||
|
|
||||||
|
RETURN_AND_SET_ERRNO(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user