X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;ds=sidebyside;f=select.c;h=15ad7070844da6915970eb992df8d686f8408d81;hb=f56aa749790691ac3a44cc9c67a0ee7055939f78;hp=6ef289152c42a77f6f14acb8042bcd345463b5f2;hpb=b556b0ba35fde1f0e3d0a61856e1ab74774d5d23;p=adu.git diff --git a/select.c b/select.c index 6ef2891..15ad707 100644 --- a/select.c +++ b/select.c @@ -436,6 +436,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 +445,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,14 +812,15 @@ 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) { - int p[2], ret, argc; + int p[2], ret; char **argv; ret = pipe(p); @@ -839,7 +841,7 @@ static int open_pipe(char *path) if (p[0] != STDIN_FILENO) dup2(p[0], STDIN_FILENO); DEBUG_LOG("executing %s\n", path); - argc = split_args(path, &argv, " \t"); + split_args(path, &argv, " \t"); execvp(argv[0], argv); ERROR_LOG("error executing %s: %s\n", path, adu_strerror(ERRNO_TO_ERROR(errno)));