mirror of
https://github.com/void-linux/void-packages.git
synced 2025-07-27 07:52:55 +02:00
mdocml: fix man when run with stdin closed.
Patch communicated by Ingo Schwarze.
This commit is contained in:
parent
433e91a869
commit
06b70f7256
2 changed files with 43 additions and 1 deletions
42
srcpkgs/mdocml/patches/stdout.patch
Normal file
42
srcpkgs/mdocml/patches/stdout.patch
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
--- main.c.orig
|
||||||
|
+++ main.c
|
||||||
|
@@ -551,10 +551,10 @@
|
||||||
|
|
||||||
|
/* Stop here until moved to the foreground. */
|
||||||
|
|
||||||
|
- tc_pgid = tcgetpgrp(STDIN_FILENO);
|
||||||
|
+ tc_pgid = tcgetpgrp(tag_files->ofd);
|
||||||
|
if (tc_pgid != man_pgid) {
|
||||||
|
if (tc_pgid == pager_pid) {
|
||||||
|
- (void)tcsetpgrp(STDIN_FILENO,
|
||||||
|
+ (void)tcsetpgrp(tag_files->ofd,
|
||||||
|
man_pgid);
|
||||||
|
if (signum == SIGTTIN)
|
||||||
|
continue;
|
||||||
|
@@ -567,7 +567,7 @@
|
||||||
|
/* Once in the foreground, activate the pager. */
|
||||||
|
|
||||||
|
if (pager_pid) {
|
||||||
|
- (void)tcsetpgrp(STDIN_FILENO, pager_pid);
|
||||||
|
+ (void)tcsetpgrp(tag_files->ofd, pager_pid);
|
||||||
|
kill(pager_pid, SIGCONT);
|
||||||
|
} else
|
||||||
|
pager_pid = spawn_pager(tag_files);
|
||||||
|
@@ -1082,7 +1082,7 @@
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
(void)setpgid(pager_pid, 0);
|
||||||
|
- (void)tcsetpgrp(STDIN_FILENO, pager_pid);
|
||||||
|
+ (void)tcsetpgrp(tag_files->ofd, pager_pid);
|
||||||
|
#if HAVE_PLEDGE
|
||||||
|
if (pledge("stdio rpath tmppath tty proc", NULL) == -1)
|
||||||
|
err((int)MANDOCLEVEL_SYSERR, "pledge");
|
||||||
|
@@ -1100,7 +1100,7 @@
|
||||||
|
|
||||||
|
/* Do not start the pager before controlling the terminal. */
|
||||||
|
|
||||||
|
- while (tcgetpgrp(STDIN_FILENO) != getpid())
|
||||||
|
+ while (tcgetpgrp(STDOUT_FILENO) != getpid())
|
||||||
|
nanosleep(&timeout, NULL);
|
||||||
|
|
||||||
|
execvp(argv[0], argv);
|
|
@ -1,7 +1,7 @@
|
||||||
# Template file for 'mdocml'
|
# Template file for 'mdocml'
|
||||||
pkgname=mdocml
|
pkgname=mdocml
|
||||||
version=1.13.4
|
version=1.13.4
|
||||||
revision=1
|
revision=2
|
||||||
build_style=configure
|
build_style=configure
|
||||||
makedepends="sqlite-devel zlib-devel"
|
makedepends="sqlite-devel zlib-devel"
|
||||||
depends="less"
|
depends="less"
|
||||||
|
|
Loading…
Add table
Reference in a new issue