about summary refs log tree commit diff
path: root/src/stat/fchmodat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stat/fchmodat.c')
-rw-r--r--src/stat/fchmodat.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/stat/fchmodat.c b/src/stat/fchmodat.c
index c1410bc5..aeb50bc5 100644
--- a/src/stat/fchmodat.c
+++ b/src/stat/fchmodat.c
@@ -4,6 +4,8 @@
 #include <stdio.h>
 #include "syscall.h"
 
+void __procfdname(char *, unsigned);
+
 int fchmodat(int fd, const char *path, mode_t mode, int flag)
 {
 	if (!flag) return syscall(SYS_fchmodat, fd, path, mode, flag);
@@ -26,7 +28,7 @@ int fchmodat(int fd, const char *path, mode_t mode, int flag)
 		return __syscall_ret(fd2);
 	}
 
-	snprintf(proc, sizeof proc, "/proc/self/fd/%d", fd2);
+	__procfdname(proc, fd2);
 	if (!(ret = __syscall(SYS_stat, proc, &st)) && !S_ISLNK(st.st_mode))
 		ret = __syscall(SYS_chmod, proc, mode);