]> git.tuebingen.mpg.de Git - adu.git/commit
Fix a design bug concerning struct user_info.
authorAndre Noll <maan@systemlinux.org>
Wed, 17 Dec 2008 22:32:21 +0000 (23:32 +0100)
committerAndre Noll <maan@systemlinux.org>
Wed, 17 Dec 2008 22:32:21 +0000 (23:32 +0100)
commitbd0166ae6242deafc9b3436199965420517033b5
tree69b48d445b4cec893c43209f049ec1897ecd25f8
parente302759338931fca58ee2497dbcc7c86ef6963bf
Fix a design bug concerning struct user_info.

It was a bad idea to include the accounting data (#files, #dirs,
information about the user only.

So move the accounting data to user_summary_info. This allows
to get rid of the ugly uid_hash_table_sort_idx construct and of
sort_hash_table(). These were only needed because of the broken
design.  We now never sort the hash table but allocate an array of
user_summary_info structures on each query and sort that array instead.

This patch not only simplifies code but also fixes a real bug noted by
Sebastian Stark: If the user_summary was requested more than once in
interactive mode, the old code computed incorrect values because the
above mentioned accounting fields were only initialized once. The new
code gets this right automatically because a fresh array is created
on each query.
create.c
select.c
user.c
user.h