Re: ldd: check read return value to avoid unitialized struct fields

2023-08-05 Thread Theo Buehler
> - if (pread(fd, phdr, size, ehdr.e_phoff) != size) { > + if ((nr = pread(fd, phdr, size, ehdr.e_phoff)) != -1) { did you intend to check for == -1? > warn("read(%s)", name); should that not say pread?

Re: ldd: check read return value to avoid unitialized struct fields

2023-08-05 Thread Theo de Raadt
Lucas wrote: > "Theo de Raadt" wrote: > > What errno is being printed here? > > """Everything is alright""" error, > > $ : >empty && ./obj/ldd empty > ldd: read(empty): Undefined error: 0 > > which would be the same as a short read in the pread below. Nope, that is not correct.

Re: ldd: check read return value to avoid unitialized struct fields

2023-08-05 Thread Theo de Raadt
That looks better. Lucas wrote: > Theo Buehler wrote: > > > - if (pread(fd, phdr, size, ehdr.e_phoff) != size) { > > > + if ((nr = pread(fd, phdr, size, ehdr.e_phoff)) != -1) { > > > > did you intend to check for == -1? > > > > > warn("read(%s)", name); > > > > should that not

Re: ldd: check read return value to avoid unitialized struct fields

2023-08-05 Thread Lucas
"Theo de Raadt" wrote: > Nope, that is not correct. > > errno is not being cleared. It just happens to be zero. Future > code changes could insert another operation above which would set > errno, and then this would print a report about that error. Although I was being sarcastic with

Re: ldd: check read return value to avoid unitialized struct fields

2023-08-05 Thread Lucas
Theo Buehler wrote: > > - if (pread(fd, phdr, size, ehdr.e_phoff) != size) { > > + if ((nr = pread(fd, phdr, size, ehdr.e_phoff)) != -1) { > > did you intend to check for == -1? > > > warn("read(%s)", name); > > should that not say pread? Indeed, thanks for spotting both

Re: ldd: check read return value to avoid unitialized struct fields

2023-08-05 Thread Lucas
"Theo de Raadt" wrote: > What errno is being printed here? """Everything is alright""" error, $ : >empty && ./obj/ldd empty ldd: read(empty): Undefined error: 0 which would be the same as a short read in the pread below. Bigger suggestion below, addressing both read and pread.

Re: standardize and simplify GitHub submodule handling in ports?

2023-08-05 Thread Marc Espie
Some comments already. I haven't looked very closely. On Sat, Aug 05, 2023 at 03:12:18PM -0400, Thomas Frohwein wrote: > The current draft hijacks post-extract target, but it would be easy to > add this to _post-extract-finalize in bsd.port.mk similar to how the > post-extract commands from

hardclock(9), roundrobin: make roundrobin() an independent clock interrupt

2023-08-05 Thread Scott Cheloha
This is the next piece of the clock interrupt reorganization patch series. This patch removes the roundrobin() call from hardclock() and makes roundrobin() an independent clock interrupt. - Revise roundrobin() to make it a valid clock interrupt callback. It remains periodic. It still runs at

Re: [www] fix broken links on loongson.html

2023-08-05 Thread Moritz Buhl
Hi, I noticed this today and commited your change. mbuhl On Tue, Jun 02, 2020 at 12:33:36PM +, Yifei Zhan wrote: > Hi, > > Several links on loongson.html are now broken as zkml.lemote.com is no > longer being resolved. > > I think it's a good idea to redirect them to their archived

Re: standardize and simplify GitHub submodule handling in ports?

2023-08-05 Thread Thomas Frohwein
On Sat, Aug 05, 2023 at 11:27:24PM +0200, Marc Espie wrote: > Some comments already. I haven't looked very closely. > On Sat, Aug 05, 2023 at 03:12:18PM -0400, Thomas Frohwein wrote: > > The current draft hijacks post-extract target, but it would be easy to > > add this to _post-extract-finalize

standardize and simplify GitHub submodule handling in ports?

2023-08-05 Thread Thomas Frohwein
Hi, GitHub projects using submodules seems to be a common enough case that I'm wondering if it would be helpful to simplify and standardize it. I got the idea when I saw how the modules for go and cargo pull in their modules or crates, respectively. The current state is that projects with