On 8/21/20 12:52 AM, YiFei Zhu wrote:
On Thu, Aug 20, 2020 at 3:38 PM Yonghong Song <yhs@xxxxxx> wrote:
+ int fd = ret;
+
+ ret = -errno;
libbpf_strerror_r understands positive and negative errno, so no need
"ret = -errno".
I don't understand this one. The use of ret = -errno here is that when
we goto out later we return a -errno. If this line is removed then fd
is returned after fd is closed, in the case of a bind map failure,
without writing to *pfd. Am I misunderstanding something?
Aha, sorry. My bad. I missed that 'ret' is used later for the negative
code return value. Yes, your code looks fine.
YiFei Zhu