summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_install/add
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>1999-07-07 06:00:25 +0000
committerMarc Espie <espie@cvs.openbsd.org>1999-07-07 06:00:25 +0000
commitccdd95a6bb27dc1fa796de134ee760d864438f07 (patch)
treea90da17191d544cb0bacf62b26d7b8cb678760b6 /usr.sbin/pkg_install/add
parent5801cef1067826e5dd9231fc285338657210b588 (diff)
show MESSAGE using PAGER
Diffstat (limited to 'usr.sbin/pkg_install/add')
-rw-r--r--usr.sbin/pkg_install/add/perform.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/usr.sbin/pkg_install/add/perform.c b/usr.sbin/pkg_install/add/perform.c
index f68849d2ef2..840a7bb093c 100644
--- a/usr.sbin/pkg_install/add/perform.c
+++ b/usr.sbin/pkg_install/add/perform.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: perform.c,v 1.8 1999/07/05 09:55:40 espie Exp $ */
+/* $OpenBSD: perform.c,v 1.9 1999/07/07 06:00:24 espie Exp $ */
#ifndef lint
-static const char *rcsid = "$OpenBSD: perform.c,v 1.8 1999/07/05 09:55:40 espie Exp $";
+static const char *rcsid = "$OpenBSD: perform.c,v 1.9 1999/07/07 06:00:24 espie Exp $";
#endif
/*
@@ -537,18 +537,16 @@ pkg_do(char *pkg)
}
if ((p = find_plist(&Plist, PLIST_DISPLAY)) != NULL) {
- FILE *fp;
+ char *Pager;
char buf[BUFSIZ];
+ struct stat sbuf;
+
+ Pager = getenv("PAGER");
+ if (!Pager)
+ Pager = "/usr/bin/more";
snprintf(buf, sizeof buf, "%s/%s", LogDir, p->name);
- fp = fopen(buf, "r");
- if (fp) {
- putc('\n', stdout);
- while (fgets(buf, sizeof(buf), fp))
- fputs(buf, stdout);
- putc('\n', stdout);
- (void) fclose(fp);
- } else
+ if (!stat(buf,&sbuf) || vsystem("%s %s", Pager, buf))
warnx("cannot open %s as display file", buf);
}