Page MenuHomeFreeBSD

pdkill(2), pdgetpid(2): return EBADF if the file type is not procdesc
ClosedPublic

Authored by kib on Wed, Aug 5, 8:09 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Aug 13, 8:38 PM
Unknown Object (File)
Thu, Aug 13, 1:08 PM
Unknown Object (File)
Thu, Aug 13, 7:54 AM
Unknown Object (File)
Thu, Aug 13, 4:10 AM
Unknown Object (File)
Thu, Aug 13, 2:28 AM
Unknown Object (File)
Thu, Aug 13, 12:48 AM
Unknown Object (File)
Wed, Aug 12, 11:49 PM
Unknown Object (File)
Wed, Aug 12, 11:40 AM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib requested review of this revision.Wed, Aug 5, 8:09 AM

Why not return EBADF unconditionally?

This revision is now accepted and ready to land.Wed, Aug 5, 1:18 PM

Why not return EBADF unconditionally?

In e18844223d1eabb7e435ff9da20d88915d3f4675 I changed from unconditional EBADF to unconditional EINVAL, because pdwait::einval test caught it.
Changing it back seems to be not an option.

In D58666#1346166, @kib wrote:

Why not return EBADF unconditionally?

In e18844223d1eabb7e435ff9da20d88915d3f4675 I changed from unconditional EBADF to unconditional EINVAL, because pdwait::einval test caught it.
Changing it back seems to be not an option.

Yes, pdwait::einval and pdwait(2) are already in 15.1-R so we need to keep EINVAL in 15.x (I don't object having EBADF in 16 if that makes more sense.)

BTW in lib/libsys/pdfork.2 we still say pddupfd(2) returns EBADF. In this patch we change it to EINVAL. It's only in main so I think we can just choose preferred one and sync the manpage.

This revision now requires review to proceed.Wed, Aug 5, 4:35 PM

Thanks and confirmed konsole(1) doesn't report false shell crash now.

This revision is now accepted and ready to land.Wed, Aug 5, 5:24 PM