| File: | src/stat/fchmodat.c |
| Location: | line 21, column 6 |
| Description: | The left operand of '&' is a garbage value |
| 1 | #include <sys/stat.h> | |||||
| 2 | #include <fcntl.h> | |||||
| 3 | #include <errno(*__errno_location()).h> | |||||
| 4 | #include "syscall.h" | |||||
| 5 | ||||||
| 6 | void __procfdname(char *, unsigned); | |||||
| 7 | ||||||
| 8 | int fchmodat(int fd, const char *path, mode_t mode, int flag) | |||||
| 9 | { | |||||
| 10 | if (!flag) return syscall(SYS_fchmodat, fd, path, mode, flag)__syscall_ret(__syscall4(268,((long) (fd)),((long) (path)),(( long) (mode)),((long) (flag)))); | |||||
| ||||||
| 11 | ||||||
| 12 | if (flag != AT_SYMLINK_NOFOLLOW0x100) | |||||
| 13 | return __syscall_ret(-EINVAL22); | |||||
| 14 | ||||||
| 15 | struct stat st; | |||||
| 16 | int ret, fd2; | |||||
| 17 | char proc[15+3*sizeof(int)]; | |||||
| 18 | ||||||
| 19 | if ((ret = __syscall(SYS_fstatat, fd, path, &st, flag)__syscall4(262,((long) (fd)),((long) (path)),((long) (&st )),((long) (flag))))) | |||||
| 20 | return __syscall_ret(ret); | |||||
| 21 | if (S_ISLNK(st.st_mode)(((st.st_mode) & 0170000) == 0120000)) | |||||
| ||||||
| 22 | return __syscall_ret(-EOPNOTSUPP95); | |||||
| 23 | ||||||
| 24 | if ((fd2 = __syscall(SYS_openat, fd, path, O_RDONLY|O_PATH|O_NOFOLLOW|O_NOCTTY|O_CLOEXEC)__syscall3(257,((long) (fd)),((long) (path)),((long) (00|010000000 |0400000|0400|02000000)))) < 0) { | |||||
| 25 | if (fd2 == -ELOOP40) | |||||
| 26 | return __syscall_ret(-EOPNOTSUPP95); | |||||
| 27 | return __syscall_ret(fd2); | |||||
| 28 | } | |||||
| 29 | ||||||
| 30 | __procfdname(proc, fd2); | |||||
| 31 | ret = __syscall(SYS_fstatat, AT_FDCWD, proc, &st, 0)__syscall4(262,((long) ((-100))),((long) (proc)),((long) (& st)),((long) (0))); | |||||
| 32 | if (!ret) { | |||||
| 33 | if (S_ISLNK(st.st_mode)(((st.st_mode) & 0170000) == 0120000)) ret = -EOPNOTSUPP95; | |||||
| 34 | else ret = __syscall(SYS_fchmodat, AT_FDCWD, proc, mode)__syscall3(268,((long) ((-100))),((long) (proc)),((long) (mode ))); | |||||
| 35 | } | |||||
| 36 | ||||||
| 37 | __syscall(SYS_close, fd2)__syscall1(3,((long) (fd2))); | |||||
| 38 | return __syscall_ret(ret); | |||||
| 39 | } |