=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/calendar/calendar.c,v retrieving revision 1.27 retrieving revision 1.28 diff -c -r1.27 -r1.28 *** src/usr.bin/calendar/calendar.c 2011/09/12 21:23:00 1.27 --- src/usr.bin/calendar/calendar.c 2012/01/31 08:29:25 1.28 *************** *** 1,4 **** ! /* $OpenBSD: calendar.c,v 1.27 2011/09/12 21:23:00 jmc Exp $ */ /* * Copyright (c) 1989, 1993, 1994 --- 1,4 ---- ! /* $OpenBSD: calendar.c,v 1.28 2012/01/31 08:29:25 otto Exp $ */ /* * Copyright (c) 1989, 1993, 1994 *************** *** 169,174 **** --- 169,175 ---- warn("fork"); continue; case 0: /* child */ + (void)setpgid(getpid(), getpid()); (void)setlocale(LC_ALL, ""); if (setusercontext(NULL, pw, pw->pw_uid, LOGIN_SETALL ^ LOGIN_SETLOGIN)) *************** *** 214,220 **** /* It doesn't _really_ matter if the kill fails, e.g. * if there's only a zombie now. */ ! (void)kill(kid, SIGTERM); warnx("uid %u did not finish in time", pw->pw_uid); } if (time(NULL) - t >= SECSPERDAY) --- 215,224 ---- /* It doesn't _really_ matter if the kill fails, e.g. * if there's only a zombie now. */ ! if (getpgid(kid) != getpgrp()) ! (void)killpg(getpgid(kid), SIGTERM); ! else ! (void)kill(kid, SIGTERM); warnx("uid %u did not finish in time", pw->pw_uid); } if (time(NULL) - t >= SECSPERDAY)