-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleanup: remove dead code handling historic Unix line disciplines
In src/cmd/ksh93/include/jobs.h, we find... #ifdef FIOLOOKLD /* Ninth edition */ extern int tty_ld, ntty_ld; # define OTTYDISC tty_ld # define NTTYDISC ntty_ld #endif /* FIOLOOKLD */ When Googling this FIOLOOKLD symbol, I got eight hits, six of them ksh93 source code. Two others are ancient UNIX sources hosted at TUHS. It checks out: UNIX Ninth Edition was from 1986. And sure enough, the code above was already in ksh86. But it is evident that no system from the last three decades has that symbol, or Google woud find some trace of it. There's quite a bit of code that depends on the OTTYDISC/NTTYDISC symbols that are only defined if FIOLOOKLD is defined. So all of that is dead code that is hereby removed. In addition, in io_prompt() in io.c there was an ioctl call that depended on the presence of the obsolete symbol TIOCLBIC. (FreeBSD and macOS have it in a special ioctl_compat.h header). The code in question, if that symbol exists, is only executed if no line editor (emacs or vi) is active. Comment says: "re-enable output in case the user has disabled it. Not needed with edit mode". But, as of 10e4ce5, we enable emacs by default if no editor is chosen. So we can get rid of this, too. It's not compiled in on most current systems anyway (if any at all). And, just like that, all the ioctl(2) calls are gone from the ksh93 directory (none of them were getting compiled in on any recent system). Which means we can also get rid of a very broken ioctl wrapper in edit.c, sh_ioctl(), which ioctl was redefined as.
- Loading branch information
Showing
8 changed files
with
2 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters