diff options
author | Olga Kornievskaia <aglo@citi.umich.edu> | 2009-11-16 09:14:31 -0500 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2009-11-16 09:14:31 -0500 |
commit | 99ed8de8261beb580c0ab9543ea7f2c8e16c9306 (patch) | |
tree | ed7065ae4807e20e140bca1dc0465405991d6188 /utils/gssd/gssd_proc.c | |
parent | b695dbb65bb199e3a9ed5a9f780ed2e575061b46 (diff) | |
download | nfs-utils-99ed8de8261beb580c0ab9543ea7f2c8e16c9306.tar.gz nfs-utils-99ed8de8261beb580c0ab9543ea7f2c8e16c9306.tar.xz nfs-utils-99ed8de8261beb580c0ab9543ea7f2c8e16c9306.zip |
gssd: refactor update_client_list()
Split out the processing for a pipe to a separate routine. The next
patch adds a new pipe to be processed.
Signed-off-by: Olga Kornievskaia <aglo@citi.umich.edu>
Signed-off-by: Kevin Coffman <kwc@citi.umich.edu>
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/gssd/gssd_proc.c')
-rw-r--r-- | utils/gssd/gssd_proc.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/utils/gssd/gssd_proc.c b/utils/gssd/gssd_proc.c index 37e2aa5..1942175 100644 --- a/utils/gssd/gssd_proc.c +++ b/utils/gssd/gssd_proc.c @@ -478,25 +478,25 @@ find_client(char *dirname) return 0; } -/* Used to read (and re-read) list of clients, set up poll array. */ -int -update_client_list(void) +static int +process_pipedir(char *pipe_name) { struct dirent **namelist; int i, j; - if (chdir(pipefs_nfsdir) < 0) { + if (chdir(pipe_name) < 0) { printerr(0, "ERROR: can't chdir to %s: %s\n", - pipefs_nfsdir, strerror(errno)); + pipe_name, strerror(errno)); return -1; } - j = scandir(pipefs_nfsdir, &namelist, NULL, alphasort); + j = scandir(pipe_name, &namelist, NULL, alphasort); if (j < 0) { printerr(0, "ERROR: can't scandir %s: %s\n", - pipefs_nfsdir, strerror(errno)); + pipe_name, strerror(errno)); return -1; } + update_old_clients(namelist, j); for (i=0; i < j; i++) { if (i < FD_ALLOC_BLOCK @@ -507,9 +507,23 @@ update_client_list(void) } free(namelist); + return 0; } +/* Used to read (and re-read) list of clients, set up poll array. */ +int +update_client_list(void) +{ + int retval = -1; + + retval = process_pipedir(pipefs_nfsdir); + if (retval) + printerr(0, "ERROR: processing %s\n", pipefs_nfsdir); + + return retval; +} + static int do_downcall(int k5_fd, uid_t uid, struct authgss_private_data *pd, gss_buffer_desc *context_token) |