projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix inadvertent introduction of extern object stx
[musl]
/
src
/
misc
/
realpath.c
diff --git
a/src/misc/realpath.c
b/src/misc/realpath.c
index
43d4018
..
d2708e5
100644
(file)
--- a/
src/misc/realpath.c
+++ b/
src/misc/realpath.c
@@
-1,13
+1,11
@@
#include <stdlib.h>
#include <stdlib.h>
-#include <stdio.h>
#include <limits.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <limits.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
-
-void __procfdname(char *, unsigned);
+#include "syscall.h"
char *realpath(const char *restrict filename, char *restrict resolved)
{
char *realpath(const char *restrict filename, char *restrict resolved)
{
@@
-22,7
+20,7
@@
char *realpath(const char *restrict filename, char *restrict resolved)
return 0;
}
return 0;
}
- fd = open(filename, O_PATH|O_NONBLOCK|O_CLOEXEC);
+ fd =
sys_
open(filename, O_PATH|O_NONBLOCK|O_CLOEXEC);
if (fd < 0) return 0;
__procfdname(buf, fd);
if (fd < 0) return 0;
__procfdname(buf, fd);
@@
-37,9
+35,9
@@
char *realpath(const char *restrict filename, char *restrict resolved)
goto err;
}
goto err;
}
-
close(
fd);
+
__syscall(SYS_close,
fd);
return resolved ? strcpy(resolved, tmp) : strdup(tmp);
err:
return resolved ? strcpy(resolved, tmp) : strdup(tmp);
err:
-
close(
fd);
+
__syscall(SYS_close,
fd);
return 0;
}
return 0;
}