Correctly detect perm errors on pat files

This commit is contained in:
Gareth Evans
2017-02-22 19:35:15 +00:00
parent 96257f9b16
commit d33f5d293e

View File

@@ -696,8 +696,7 @@ int LoadPAT(char *filename)
/* Load .az antenna pattern file */
if( (fd = fopen(azfile, "r")) == NULL )
return errno;
if( (fd = fopen(azfile, "r")) != NULL ){
/* Clear azimuth pattern array */
@@ -824,11 +823,13 @@ int LoadPAT(char *filename)
azimuth_pattern[360] = azimuth_pattern[0];
got_azimuth_pattern = 255;
}else if( errno == EACCES ){
return errno;
}
/* Read and process .el file */
if( (fd = fopen(elfile, "r")) == NULL )
return errno;
if( (fd = fopen(elfile, "r")) != NULL ){
for (x = 0; x <= 10000; x++) {
el_pattern[x] = 0.0;
@@ -1008,6 +1009,9 @@ int LoadPAT(char *filename)
LR.antenna_pattern[x][y] = az * elevation;
}
}
}else if( errno == EACCES ){
return errno;
}
return 0;
}