Skip to content

Conversation

chrissamuel
Copy link
Contributor

When running build_generic_data.sh I was getting errors like:

readline() on closed filehandle FILE at /path/to/smatch/smatch_scripts/../smatch_data/db/init_constraints.pl line 54.
readline() on closed filehandle FILE at /path/to/smatch/smatch_scripts/../smatch_data/db/init_constraints.pl line 61.
readline() on closed filehandle FILE at /path/to/smatch/smatch_scripts/../smatch_data/db/init_constraints_required.pl line 42.
off
off
readline() on closed filehandle FILE at /path/to/smatch/smatch_scripts/../smatch_data/db/insert_manual_states.pl line 68.

This is because the Perl scripts read from filehandles without checking if the open succeeded. These files don't exist for a new generic project so this commit changes the scripts to only try and read from them if their open() succeeds.

When running `build_generic_data.sh` I was getting errors like:
```
readline() on closed filehandle FILE at /path/to/smatch/smatch_scripts/../smatch_data/db/init_constraints.pl line 54.
readline() on closed filehandle FILE at /path/to/smatch/smatch_scripts/../smatch_data/db/init_constraints.pl line 61.
readline() on closed filehandle FILE at /path/to/smatch/smatch_scripts/../smatch_data/db/init_constraints_required.pl line 42.
off
off
readline() on closed filehandle FILE at /path/to/smatch/smatch_scripts/../smatch_data/db/insert_manual_states.pl line 68.
```
This is because the Perl scripts read from filehandles without
checking if the open succeeded. These files don't exist for a
new generic project so this commit changes the scripts to only
try and read from them if their `open()` succeeds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant