forked from ExternalVendorCode/Signal-Server
Correctly detect perm errors on pat files
This commit is contained in:
12
inputs.cc
12
inputs.cc
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user