From 9a19a32e659f26c046d0621127ebaf63b4b73b69 Mon Sep 17 00:00:00 2001 From: Fritz Elfert Date: Sat, 11 Nov 2000 21:20:52 +0000 Subject: Fixed hang in Mail subdirectory. Corrected missing calculation for link-counts of directories. --- plpftp/Makefile.am | 4 ++-- plpftp/ftp.cc | 6 ++++-- plpnfsd/mp_inode.c | 2 +- plpnfsd/mp_pfs_ops.c | 3 ++- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/plpftp/Makefile.am b/plpftp/Makefile.am index 4805577..ba8e40c 100644 --- a/plpftp/Makefile.am +++ b/plpftp/Makefile.am @@ -15,8 +15,8 @@ endif bin_PROGRAMS = plpftp plpftp_LDADD = $(top_srcdir)/lib/libplp.la $(LIBREADLINE) $(LIBHISTORY) -plpftp_SOURCES = ftp.cc main.cc -EXTRA_DIST = ftp.h +plpftp_SOURCES = ftp.cc main.cc rlcrap.c +EXTRA_DIST = ftp.h rlcrap.h maintainer-clean-local: rm -f Makefile.in diff --git a/plpftp/ftp.cc b/plpftp/ftp.cc index 41fa429..27c9fac 100644 --- a/plpftp/ftp.cc +++ b/plpftp/ftp.cc @@ -55,6 +55,7 @@ extern "C" { #if HAVE_LIBHISTORY #include #endif +#include "rlcrap.h" } #endif @@ -1008,7 +1009,7 @@ do_completion(char *text, int start, int end) rl_completion_entry_function = (Function *)null_completion; if (start == 0) - matches = completion_matches(text, (CPFunction *)command_generator); + matches = completion_matches(text, cmdgen_ptr); else { int idx = 0; char *name; @@ -1029,7 +1030,7 @@ do_completion(char *text, int start, int end) maskAttr = rfsv::PSI_A_DIR; } - matches = completion_matches(text, (CPFunction *)filename_generator); + matches = completion_matches(text, fnmgen_ptr); } return matches; } @@ -1042,6 +1043,7 @@ initReadline(void) rl_readline_name = "plpftp"; rl_completion_entry_function = (Function *)null_completion; rl_attempted_completion_function = (CPPFunction *)do_completion; + rlcrap_setpointers(command_generator, filename_generator); #endif } diff --git a/plpnfsd/mp_inode.c b/plpnfsd/mp_inode.c index 2432dda..a78c779 100644 --- a/plpnfsd/mp_inode.c +++ b/plpnfsd/mp_inode.c @@ -20,7 +20,7 @@ #include #define strdup NXCopyStringBuffer #endif -#define HASHSIZE 99 +#define HASHSIZE 999 static int nextinode = 6; static p_inode *numtab[HASHSIZE]; diff --git a/plpnfsd/mp_pfs_ops.c b/plpnfsd/mp_pfs_ops.c index 69191e6..9418c5d 100644 --- a/plpnfsd/mp_pfs_ops.c +++ b/plpnfsd/mp_pfs_ops.c @@ -681,7 +681,8 @@ nfsproc_getattr_2(struct nfs_fh *fh) if ((cp = search_cache(attrcache, inode->inode))) { debuglog("getattr: cache hit\n"); *fp = cp->attr; /* gotcha */ - return &res; + if (fp->nlink > 0) + return &res; } l = strlen(inode->name); -- cgit v1.2.3