leave.c (32295) | leave.c (35182) |
---|---|
1/* 2 * Copyright (c) 1980, 1988, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 28 unchanged lines hidden (view full) --- 37 The Regents of the University of California. All rights reserved.\n"; 38#endif /* not lint */ 39 40#ifndef lint 41#if 0 42static char sccsid[] = "@(#)leave.c 8.1 (Berkeley) 6/6/93"; 43#endif 44static const char rcsid[] = | 1/* 2 * Copyright (c) 1980, 1988, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 28 unchanged lines hidden (view full) --- 37 The Regents of the University of California. All rights reserved.\n"; 38#endif /* not lint */ 39 40#ifndef lint 41#if 0 42static char sccsid[] = "@(#)leave.c 8.1 (Berkeley) 6/6/93"; 43#endif 44static const char rcsid[] = |
45 "$Id: leave.c,v 1.2 1997/07/21 12:04:31 charnier Exp $"; | 45 "$Id: leave.c,v 1.3 1998/01/06 17:27:09 helbig Exp $"; |
46#endif /* not lint */ 47 48#include <err.h> 49#include <ctype.h> 50#include <locale.h> 51#include <stdio.h> 52#include <time.h> 53#include <unistd.h> --- 93 unchanged lines hidden (view full) --- 147 if ((pid = fork())) { 148 (void)time(&daytime); 149 daytime += secs; 150 strftime(tb, sizeof(tb), "%+", localtime(&daytime)); 151 printf("Alarm set for %s. (pid %d)\n", tb, pid); 152 exit(0); 153 } 154 sleep((u_int)2); /* let parent print set message */ | 46#endif /* not lint */ 47 48#include <err.h> 49#include <ctype.h> 50#include <locale.h> 51#include <stdio.h> 52#include <time.h> 53#include <unistd.h> --- 93 unchanged lines hidden (view full) --- 147 if ((pid = fork())) { 148 (void)time(&daytime); 149 daytime += secs; 150 strftime(tb, sizeof(tb), "%+", localtime(&daytime)); 151 printf("Alarm set for %s. (pid %d)\n", tb, pid); 152 exit(0); 153 } 154 sleep((u_int)2); /* let parent print set message */ |
155 secs -= 2; | 155 if (secs >= 2) 156 secs -= 2; |
156 157 /* 158 * if write fails, we've lost the terminal through someone else 159 * causing a vhangup by logging in. 160 */ 161#define FIVEMIN (5 * 60) 162#define MSG2 "\07\07You have to leave in 5 minutes.\n" 163 if (secs >= FIVEMIN) { --- 32 unchanged lines hidden --- | 157 158 /* 159 * if write fails, we've lost the terminal through someone else 160 * causing a vhangup by logging in. 161 */ 162#define FIVEMIN (5 * 60) 163#define MSG2 "\07\07You have to leave in 5 minutes.\n" 164 if (secs >= FIVEMIN) { --- 32 unchanged lines hidden --- |