about summary refs log tree commit diff
path: root/src/usr.bin/calendar
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2017-09-14 13:29:21 +0200
committerLeah Neukirchen <leah@vuxu.org>2017-09-14 13:29:21 +0200
commit21aa46256916122007b3db3ebc1096ad34105957 (patch)
tree6feb7fdbcaa936a5705cedf9b45262a01da55036 /src/usr.bin/calendar
parentc6fe3a3f95b447a221ba51f9807d796d88a0580d (diff)
downloadoutils-21aa46256916122007b3db3ebc1096ad34105957.tar.gz
outils-21aa46256916122007b3db3ebc1096ad34105957.tar.xz
outils-21aa46256916122007b3db3ebc1096ad34105957.zip
cvs update
Diffstat (limited to 'src/usr.bin/calendar')
-rw-r--r--src/usr.bin/calendar/calendars/calendar.ushistory4
-rw-r--r--src/usr.bin/calendar/io.c17
2 files changed, 10 insertions, 11 deletions
diff --git a/src/usr.bin/calendar/calendars/calendar.ushistory b/src/usr.bin/calendar/calendars/calendar.ushistory
index 684dc25..a46a542 100644
--- a/src/usr.bin/calendar/calendars/calendar.ushistory
+++ b/src/usr.bin/calendar/calendars/calendar.ushistory
@@ -1,7 +1,7 @@
 /*
  * USA history
  *
- * $OpenBSD: calendar.ushistory,v 1.6 2016/11/19 12:41:22 otto Exp $
+ * $OpenBSD: calendar.ushistory,v 1.7 2017/06/29 07:01:49 jmc Exp $
  */
 
 #ifndef _calendar_ushistory_
@@ -93,7 +93,7 @@
 06/26	Battle of Gettysburg, 1863
 06/27	100 degrees F, Fort Yukon, 1915
 06/27	Bill Graham closes the Fillmore East, 1971
-06/28	Supreme Court decides in favor of Alan Bakke, 1978
+06/28	Supreme Court decides in favor of Allan Bakke, 1978
 07/01	Battle of Gettysburg begins, 1863
 07/04	Cloudy, 76 degrees F, Philadelphia PA, 1776
 07/04	New York abstains on Declaration of Independence vote, 1776
diff --git a/src/usr.bin/calendar/io.c b/src/usr.bin/calendar/io.c
index e4cb689..8abe799 100644
--- a/src/usr.bin/calendar/io.c
+++ b/src/usr.bin/calendar/io.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: io.c,v 1.44 2016/08/31 09:38:47 jsg Exp $	*/
+/*	$OpenBSD: io.c,v 1.46 2017/08/21 21:41:13 deraadt Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993, 1994
@@ -89,13 +89,9 @@ cal(void)
 		if (strncmp(buf, "LANG=", 5) == 0) {
 			(void) setlocale(LC_ALL, buf + 5);
 			setnnames();
-			/* XXX remove KOI8 lines after 5.9 is out */
 			if (!strcmp(buf + 5, "ru_RU.UTF-8") ||
 			    !strcmp(buf + 5, "uk_UA.UTF-8") ||
-			    !strcmp(buf + 5, "by_BY.UTF-8") ||
-			    !strcmp(buf + 5, "ru_RU.KOI8-R") ||
-			    !strcmp(buf + 5, "uk_UA.KOI8-U") ||
-			    !strcmp(buf + 5, "by_BY.KOI8-B")) {
+			    !strcmp(buf + 5, "by_BY.UTF-8")) {
 				bodun_maybe++;
 				bodun = 0;
 				free(prefix);
@@ -389,6 +385,7 @@ closecal(FILE *fp)
 	struct stat sbuf;
 	int nread, pdes[2], status;
 	char buf[1024];
+	pid_t pid;
 
 	if (!doall)
 		return;
@@ -398,7 +395,7 @@ closecal(FILE *fp)
 		goto done;
 	if (pipe(pdes) < 0)
 		goto done;
-	switch (vfork()) {
+	switch ((pid = vfork())) {
 	case -1:			/* error */
 		(void)close(pdes[0]);
 		(void)close(pdes[1]);
@@ -425,8 +422,10 @@ closecal(FILE *fp)
 		(void)write(pdes[1], buf, nread);
 	(void)close(pdes[1]);
 done:	(void)fclose(fp);
-	while (wait(&status) >= 0)
-		;
+	while (waitpid(pid, &status, 0) == -1) {
+		if (errno != EINTR)
+			break;
+	}
 }