On Tue, 2010-09-14 at 17:29 +0200, Nikola Pajkovsky wrote:
On 09/14/2010 05:08 PM, Denys Vlasenko wrote:
I noticed that ->locked and ->opened members are always the same (either 0 or 1), and I decided to drop ->opened. And do a few other trivial optimizations/cleanups.
While working on it, I noticed that dd_save_binary has "opened" check inverted, and that dd_create and dd_open are leaking dd->dd_dir on error path.
So the patch turned from optimization to bugfix.
Please review.
As you pointed before that some members in structure could be too generic
typedef struct dump_dir { char *dd_dir; DIR *next_dir;
- int opened; int locked; uid_t uid; <-- here gid_t gid; <-- here
}
Yep, I added dd_ prefix and pushed the change to git