Page MenuHomeFreeBSD

devel/qt5-core: Add a patch that fixes QLockFilePrivate::processNameByPid() function to return non-truncated name.
ClosedPublic

Authored by arrowd on Jun 6 2018, 10:02 AM.

Details

Summary

String returned from sysctl() can't be longer than COMMLEN (19) symbols, so it returns bogus data for processes with long file name.
Use kvm and procstat librarires to obtain correct name and only use sysctl as a fallback.

Test Plan

make check for qlockfile passes.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

You need to bump the PORTTREVISION too.

devel/qt5-core/files/patch-src_corelib_io_qlockfile__unix.cpp
16 ↗(On Diff #43356)

^ shouldn't there be some chekc on the return value of kvm_open?

59 ↗(On Diff #43356)

^ name is already defined on line 49.

  • Error handling
  • Bump PORTREVISION
rakuco added inline comments.
devel/qt5-core/files/patch-src_corelib_io_qlockfile__unix.cpp
11 ↗(On Diff #43420)

Isn't it easier to just add a freebsd condition in the else block below?

} else {
  SOURCES += ...
  freebsd {
    LIBS += lkvm -lprocstat
  }
}
34 ↗(On Diff #43420)

Style: the * needs to be next to kp (this applies to the other pointer declarations below too).

50 ↗(On Diff #43420)

Style: this should've been part of the previous line.

68 ↗(On Diff #43420)

Same here.

arrowd marked 4 inline comments as done.
  • Address rakuco's comments.

If @rakuco has nothing more to add, it looks fine to me.

Looks OK to me. It'd be good to clean this up and submit the patch upstream later.

This revision is now accepted and ready to land.Jun 12 2018, 5:43 AM
This revision was automatically updated to reflect the committed changes.

The patch file (148 lines) contains the same 74 line patch twice, thus the build doesn't even start because of "patch failed".