Commit 9e256e6
committed
sysx/xattr: fix getxattrAll
The current implementation is suboptimal for two reasons:
* the initial buffer size of 5 bytes makes no sense
(my guess someone forgot to change it back to a sane
value after the retry logic testing);
* it never gets the real buffer size, resulting in extra
iterations (5 -> 10 -> 20 -> ...).
This commit
* sets the initial size to 128;
* uses the logic to get the real size in case we get ERANGE
Signed-off-by: Kir Kolyshkin <[email protected]>1 parent 26c1120 commit 9e256e6
1 file changed
Lines changed: 12 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| |||
66 | 65 | | |
67 | 66 | | |
68 | 67 | | |
69 | | - | |
| 68 | + | |
70 | 69 | | |
71 | 70 | | |
72 | 71 | | |
| |||
102 | 101 | | |
103 | 102 | | |
104 | 103 | | |
105 | | - | |
106 | | - | |
107 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
108 | 109 | | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | 110 | | |
115 | 111 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
124 | 117 | | |
| 118 | + | |
125 | 119 | | |
0 commit comments