Commit 9ab0ec6
committed
Lchmod(): simplify and optimize
A quote from fchmodat(2) man page (this one is for Linux, others should be similar):
> If pathname is relative and dirfd is the special value
> AT_FDCWD, then pathname is interpreted relative to the current working
> directory of the calling process (like chmod()).
>
> If pathname is absolute, then dirfd is ignored.
So, instead of calling filepath.Abs() let's use AT_FDCWD and let the
kernel figure things out for us.
While at it, fix the comment.
Signed-off-by: Kir Kolyshkin <[email protected]>1 parent 2b69c16 commit 9ab0ec6
1 file changed
Lines changed: 3 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
| |||
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
40 | 32 | | |
41 | 33 | | |
42 | 34 | | |
| |||
0 commit comments