[2124] in testers
rt 7.4F: sleep
daemon@ATHENA.MIT.EDU (mhpower@Athena.MIT.EDU)
Thu Jun 18 11:06:30 1992
From: mhpower@Athena.MIT.EDU
To: testers@Athena.MIT.EDU
Date: Thu, 18 Jun 92 11:06:01 EDT
System name: steve-dallas
Type and version: RTPC-ROMPC 7.4F (1 update(s) to same version)
Display type: apa16
What were you trying to do?
Violate causality (actually, it was more of a typo...)
What's wrong:
% /usr/bin/sleep -3600 && /bin/echo 'One hour has elapsed.'
bad character
One hour has elapsed.
What should have happened:
Since the sleep program terminated abnormally, its exit status
should've been nonzero, and thus /bin/echo shouldn't have been
executed.
*** sleep.c.old Thu Jun 18 10:53:00 1992
--- sleep.c Thu Jun 18 10:53:44 1992
***************
*** 8,20 ****
n = 0;
if(argc < 2) {
printf("arg count\n");
! exit(0);
}
s = argv[1];
while(c = *s++) {
if(c<'0' || c>'9') {
printf("bad character\n");
! exit(0);
}
n = n*10 + c - '0';
}
--- 8,20 ----
n = 0;
if(argc < 2) {
printf("arg count\n");
! exit(1);
}
s = argv[1];
while(c = *s++) {
if(c<'0' || c>'9') {
printf("bad character\n");
! exit(1);
}
n = n*10 + c - '0';
}
Please describe any relevant documentation references:
sleep(1)