X-Git-Url: http://git.vrable.net/?p=cumulus.git;a=blobdiff_plain;f=main.cc;h=a8e345fee03a53976b1b803ce767293b50fbdeb9;hp=6b9f457eae60f3a29f268071981e134f683c7545;hb=cdbe16714a926da9f8ae752027138aa15cda7f60;hpb=36e15463221ffb8f2e1dc9903705d7be81d1d1f8 diff --git a/main.cc b/main.cc index 6b9f457..a8e345f 100644 --- a/main.cc +++ b/main.cc @@ -541,6 +541,7 @@ void try_merge_filter(const string& path, const string& basedir) * one block (1 MB) worth of data. If the file doesn't seems like it might * be larger than that, don't parse the rules in it. */ ssize_t bytes = file_read(fd, block_buf, LBS_BLOCK_SIZE); + close(fd); if (bytes < 0 || bytes >= static_cast(LBS_BLOCK_SIZE - 1)) { /* TODO: Add more strict resource limits on merge files? */ fprintf(stderr, @@ -585,7 +586,8 @@ void scanfile(const string& path) DIR *dir = opendir(path.c_str()); if (dir == NULL) { - fprintf(stderr, "Error: %m\n"); + fprintf(stderr, "Error reading directory %s: %m\n", + path.c_str()); return; }