Skip to content

Commit

Permalink
Fix logic for detecting conf files.
Browse files Browse the repository at this point in the history
The logic for detecting if a file exists was backwards. It would treat a
file as existing if it could *not* be opened. Reverse that logic so it
works.

This fixes #135.
  • Loading branch information
mstemm committed Oct 24, 2016
1 parent 5f9f5c4 commit ae7f5eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions userspace/falco/falco.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,14 +337,14 @@ int falco_init(int argc, char **argv)
else
{
conf_stream.open(FALCO_SOURCE_CONF_FILE);
if (!conf_stream.is_open())
if (conf_stream.is_open())
{
conf_filename = FALCO_SOURCE_CONF_FILE;
}
else
{
conf_stream.open(FALCO_INSTALL_CONF_FILE);
if (!conf_stream.is_open())
if (conf_stream.is_open())
{
conf_filename = FALCO_INSTALL_CONF_FILE;
}
Expand Down

0 comments on commit ae7f5eb

Please sign in to comment.