Page MenuHomeFreeBSD

flua: add posix.unistd.dup2()
ClosedPublic

Authored by ifreund_freebsdfoundation.org on Mon, May 5, 8:48 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, May 18, 8:15 PM
Unknown Object (File)
Sun, May 18, 1:58 PM
Unknown Object (File)
Mon, May 12, 1:42 PM
Unknown Object (File)
Mon, May 12, 7:47 AM
Unknown Object (File)
Fri, May 9, 10:42 AM
Unknown Object (File)
Thu, May 8, 11:06 PM
Unknown Object (File)
Thu, May 8, 10:53 PM
Unknown Object (File)
Thu, May 8, 4:29 PM
Subscribers

Details

Summary

Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 64083
Build 60967: arc lint + arc unit

Event Timeline

libexec/flua/modules/lposix.c
175

why doesn't this require a goto err too?

libexec/flua/modules/lposix.c
175

This function raises a lua error on failure and does not return.

Internally it longjmps away to somewhere else in the lua VM and either invokes an error handler if in a pcall() context or prints a stack trace and exits.

The luaL_checkinteger calls below behave the same.

emaste added inline comments.
libexec/flua/modules/lposix.c
174

We seem to have a number of different styles for the arg and extramsg args of luaL_argcheck

  • _exit narg == 1, 1
  • basename narg > 0, 1
  • chmod n == 2, n > 2 ? 3 : n
  • chown n > 1, n

some include the function (close takes exactly one argument (fd)) while some do not (at least one argument required).

Independent of this change we could do a pass to rationalize these

This revision is now accepted and ready to land.Tue, May 6, 3:06 PM
libexec/flua/modules/lposix.c
174

I opened D50273 to clean this up.

This revision now requires review to proceed.Sun, May 11, 3:27 PM
This revision is now accepted and ready to land.Sun, May 11, 3:30 PM

As an aside while MFCing some flua work I (re)discovered 1f31e00e19f9e24d4c891a24973e08a027c4f71c

As an aside while MFCing some flua work I (re)discovered 1f31e00e19f9e24d4c891a24973e08a027c4f71c

Interesting, I wasn't aware of fbsd.exec. Unfortunately it doesn't look flexible enough to support the bsddialog use-case as it lacks a way to capture stderr output.

This revision was automatically updated to reflect the committed changes.