Page MenuHomeFreeBSD

periodic: replace "tty" with "test -t 0"
ClosedPublic

Authored by asomers on Aug 18 2019, 5:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 6, 6:08 AM
Unknown Object (File)
Mon, Sep 29, 8:42 PM
Unknown Object (File)
Sun, Sep 28, 11:39 PM
Unknown Object (File)
Thu, Sep 25, 11:31 AM
Unknown Object (File)
Sun, Sep 21, 2:09 AM
Unknown Object (File)
Tue, Sep 16, 9:36 PM
Unknown Object (File)
Aug 28 2025, 7:47 AM
Unknown Object (File)
Aug 19 2025, 9:32 PM
Subscribers
None

Details

Summary

periodic: replace "tty" with "test -t 0"

Apparently using tty for this purpose has been deprecated since 4.4 Lite.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

cy requested changes to this revision.Aug 18 2019, 6:41 PM
cy added inline comments.
usr.sbin/periodic/periodic.sh
87 ↗(On Diff #60971)

can this be if [ -t 0] ?

test fork()s and exec()s a new process whereas [ performs the test within the shell, saving a fork() & exec().

This revision now requires changes to proceed.Aug 18 2019, 6:41 PM

Thanks. LGTM.

usr.sbin/periodic/periodic.sh
89 ↗(On Diff #60975)

Sorry for missing this before but there is nothing between this else end endif. Did you mean

export PERIODIC_IS_INTERACTIVE=0

or unset PERIODIC_IS_INTERACTIVE

usr.sbin/periodic/periodic.sh
89 ↗(On Diff #60975)

Oh, crap, I meant to delete that. It was only there for debugging purposes.

This revision is now accepted and ready to land.Aug 19 2019, 1:09 AM
This revision was automatically updated to reflect the committed changes.