Re: [PATCH bpf-next 3/5] libbpf: Add BPF_PROG_BIND_MAP syscall and use it on .metadata section

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





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




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux