Skip to content

Prevent Perl errors building DBs for generic projects #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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