aboutsummaryrefslogtreecommitdiffstats
path: root/plpnfsd
diff options
context:
space:
mode:
authorFritz Elfert <felfert@to.com>2001-02-01 02:03:25 +0000
committerFritz Elfert <felfert@to.com>2001-02-01 02:03:25 +0000
commit6c9647c1866b49d61ea3ce7d9201450fa0497b52 (patch)
treed240f512fb1a5d72f5b0fe3ad4b60c937cfd8274 /plpnfsd
parent320ed6edbbde5936ac07247896fbc2f51505a469 (diff)
downloadplptools-6c9647c1866b49d61ea3ce7d9201450fa0497b52.tar.gz
plptools-6c9647c1866b49d61ea3ce7d9201450fa0497b52.tar.bz2
plptools-6c9647c1866b49d61ea3ce7d9201450fa0497b52.zip
More cleanup:
- Removed bool.h and references to it everywhere. This is checked now in ./configure and the stuff went into acconfig.h - Replaced ugly bufferStore-based method of returning directory entries from rfsv::readdir() by a cleaner way. (A new, separate class PlpDirent is returned now.) With the old implementation, the caller has to know about the layout of the entries. Also, the old implementation was not 64bit aware. - Similar replacement done for rfsv::dir(). This now returns the entries in a standard STL container (deque) instead of a bufferArray. - Started renaming #include statements for standard library headers from the old <xxx.h> form to the new recommended <xxx> form.
Diffstat (limited to 'plpnfsd')
-rw-r--r--plpnfsd/main.cc19
1 files changed, 9 insertions, 10 deletions
diff --git a/plpnfsd/main.cc b/plpnfsd/main.cc
index 261dfd5..96c2be4 100644
--- a/plpnfsd/main.cc
+++ b/plpnfsd/main.cc
@@ -4,7 +4,7 @@
//
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
#endif
#include <stream.h>
@@ -14,7 +14,6 @@
#include <signal.h>
#include <syslog.h>
-#include "bool.h"
#include "rfsv.h"
#include "rpcs.h"
#include "rfsvfactory.h"
@@ -210,24 +209,24 @@ long rfsv_isalive() {
}
long rfsv_dir(const char *file, dentry **e) {
- bufferArray entries;
+ PlpDir entries;
dentry *tmp;
long ret;
if (!a)
return -1;
ret = a->dir(file, entries);
- while (!entries.empty()) {
- bufferStore s;
- s = entries.pop();
+
+ for (int i = 0; i < entries.size(); i++) {
+ PlpDirent pe = entries[i];
tmp = *e;
*e = (dentry *)malloc(sizeof(dentry));
if (!*e)
return -1;
- (*e)->time = ((PsiTime *)s.getDWord(0))->getTime();
- (*e)->size = s.getDWord(4);
- (*e)->attr = s.getDWord(8);
- (*e)->name = strdup(s.getString(12));
+ (*e)->time = pe.getPsiTime().getTime();
+ (*e)->size = pe.getSize();
+ (*e)->attr = pe.getAttr();
+ (*e)->name = strdup(pe.getName());
(*e)->next = tmp;
}
return ret;