X-Git-Url: http://git.tuebingen.mpg.de/?p=adu.git;a=blobdiff_plain;f=select.c;h=a1fc1c20512b3038b0500cf7feefb3891bd76b7a;hp=d052dfb953bf0f1f1159716107ed467e87436925;hb=272ef6dcb6bb9fbc6e4f2e2368329097fd80c5a9;hpb=cc858ad54f6f5d5d35ea6473b92aad9186c8e363 diff --git a/select.c b/select.c index d052dfb..a1fc1c2 100644 --- a/select.c +++ b/select.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008 Andre Noll + * Copyright (C) 2008 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -19,6 +19,7 @@ #include "error.h" #include "user.h" #include "select.cmdline.h" +#include "select.h" /** \cond */ /* global list */ @@ -167,7 +168,7 @@ struct user_summary_loop_data { static FILE *output_file; -__printf_1_2 static int output(const char const *fmt, ...) +__printf_1_2 static int output(const char *fmt, ...) { va_list argp; int ret; @@ -436,6 +437,7 @@ static int print_global_summary(struct format_info *fi) return output("%s", select_conf.trailer_arg); } +/* row: a pointer to a row of the *user* table */ static int user_summary_loop_function(struct osl_row *row, void *data) { struct user_summary_info *usi = data; @@ -444,7 +446,7 @@ static int user_summary_loop_function(struct osl_row *row, void *data) if (usi->preg) { char *dirname; - ret = get_dir_name_of_row(row, &dirname); + ret = get_dir_name_of_user_row(row, usi->ui, &dirname); if (ret < 0) goto err; ret = dir_is_admissible(dirname, usi->preg, usi->inverse_matching); @@ -811,9 +813,10 @@ static int print_statistics(struct format_info *fi) return print_user_lists(fi); case select_mode_arg_user_summary: return print_user_summary(fi); + default: + ERROR_LOG("bad select mode\n"); + return -ERRNO_TO_ERROR(EINVAL); }; - ERROR_LOG("bad select mode\n"); - return -ERRNO_TO_ERROR(EINVAL); } static int open_pipe(char *path)