summaryrefslogtreecommitdiff
path: root/UEngines.pas
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@tbzatek.englab.brq.redhat.com>2008-06-11 13:17:03 +0200
committerTomas Bzatek <tbzatek@tbzatek.englab.brq.redhat.com>2008-06-11 13:17:03 +0200
commit540cad830d639a57d9effe9b18283b3bb8cd7a07 (patch)
tree75ceefaa14141132af94fb53dce5df51ca36b131 /UEngines.pas
parentcebc238e75cab324c8440cb9cb4293eaf949188c (diff)
downloadtuxcmd-540cad830d639a57d9effe9b18283b3bb8cd7a07.tar.xz
TLocalTreeEngine: Print warning messages when something goes wrong
Diffstat (limited to 'UEngines.pas')
-rw-r--r--UEngines.pas12
1 files changed, 9 insertions, 3 deletions
diff --git a/UEngines.pas b/UEngines.pas
index 5edc0d1..e490cca 100644
--- a/UEngines.pas
+++ b/UEngines.pas
@@ -549,7 +549,7 @@ var Handle : PDirectoryStream;
StatBuf_local := Libc.malloc(sizeof(TGlibc_stat64));
Libc.memset(StatBuf_local, 0, sizeof(TGlibc_stat64));
if glibc_lstat64(PChar(FPath), StatBuf_local) <> 0 then begin
- DebugMsg(['*** Error reading file stat AddEntry(lstat): ', strerror(errno)]);
+ DebugMsg(['*** TLocalTreeEngine.FillDirFiles: Error reading file stat AddEntry("', FPath, '"): ', strerror(errno)]);
Exit;
end;
Item := Libc.malloc(SizeOf(TDataItemSL));
@@ -610,7 +610,10 @@ begin
AddEntry(APath, True, True);
FilesList := TList.Create;
APath := IncludeTrailingPathDelimiter(APath);
- if __chdir(PChar(APath)) <> 0 then Exit;
+ if __chdir(PChar(APath)) <> 0 then begin
+ DebugMsg(['*** TLocalTreeEngine.FillDirFiles: chdir to "', APath, '" failed: ', strerror(errno)]);
+ Exit;
+ end;
Handle := OpenDir(PChar(APath));
if Assigned(Handle) then
repeat
@@ -618,7 +621,10 @@ begin
if Assigned(DirEnt) and Assigned(PChar(@DirEnt^.d_name[0])) and (PChar(@DirEnt^.d_name[0]) <> '.') and (PChar(@DirEnt^.d_name[0]) <> '..') then begin
StatBuf_global := Libc.malloc(sizeof(TGlibc_stat64));
Libc.memset(StatBuf_global, 0, sizeof(TGlibc_stat64));
- if glibc_lstat64(PChar(@DirEnt^.d_name[0]), StatBuf_global) <> 0 then Continue;
+ if glibc_lstat64(PChar(@DirEnt^.d_name[0]), StatBuf_global) <> 0 then begin
+ DebugMsg(['*** TLocalTreeEngine.FillDirFiles: Error lstat-ing ("', PChar(@DirEnt^.d_name[0]), '"): ', strerror(errno)]);
+ Continue;
+ end;
if __S_ISTYPE(StatBuf_global^.st_mode, __S_IFDIR) then begin
FillDirFiles(APath + String(PChar(@DirEnt^.d_name[0])), List, ALevel + 1);
__chdir(PChar(APath));