dtlogin: start to resolve static analysis warnings

Also convert some K&R function declarations to ansi
This commit is contained in:
Peter Howkins
2014-12-23 17:49:11 +00:00
parent 29294e0373
commit e54c164fe1
13 changed files with 215 additions and 317 deletions

View File

@@ -213,6 +213,12 @@ TrimErrorFile( void )
(f2 = open(errorLogFile, O_RDWR)) < 0 ) {
Debug("TrimErrorLog(): Cannot open file %s, error number = %d\n",
errorLogFile, errno);
if(f1 >= 0) {
close(f1);
}
if(f2 >= 0) {
close(f2);
}
return;
}
@@ -225,6 +231,8 @@ TrimErrorFile( void )
if ( (status = lseek(f2, deleteBytes, SEEK_SET)) < 0 ) {
Debug("TrimErrorLog(): Cannot lseek() in file %s, error number = %d\n",
errorLogFile, errno);
close(f1);
close(f2);
return;
}