Return value error check for times() requires an explicit cast

This commit is contained in:
Pierre Pronchery 2006-01-27 03:38:48 +00:00
parent e624966310
commit 2536132751

View File

@ -21,7 +21,7 @@ static int _time(char * argv[])
struct tms tmsbuf;
clock_t cbefore, cafter;
if((cbefore = times(NULL)) == -1)
if((cbefore = times(NULL)) == (clock_t)-1)
return _time_error("times", 2);
if((pid = fork()) == -1)
return _time_error("fork", 2);
@ -34,7 +34,7 @@ static int _time(char * argv[])
if(WIFEXITED(status))
break;
}
if((cafter = times(&tmsbuf)) == -1)
if((cafter = times(&tmsbuf)) == (clock_t)-1)
return _time_error("times", 2);
return _time_print(cafter - cbefore,
tmsbuf.tms_utime + tmsbuf.tms_cutime,