=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/calendar/io.c,v retrieving revision 1.44 retrieving revision 1.46 diff -u -r1.44 -r1.46 --- src/usr.bin/calendar/io.c 2016/08/31 09:38:47 1.44 +++ src/usr.bin/calendar/io.c 2017/08/21 21:41:13 1.46 @@ -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 @@ 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 @@ struct stat sbuf; int nread, pdes[2], status; char buf[1024]; + pid_t pid; if (!doall) return; @@ -398,7 +395,7 @@ 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 @@ (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; + } }