840 |
// Get information for directory entry |
// Get information for directory entry |
841 |
sprintf(fullpath, "%s/%s", dirname, pdirent->d_name); |
sprintf(fullpath, "%s/%s", dirname, pdirent->d_name); |
842 |
|
|
|
/* JIF |
|
|
printf("Stat: %s\n", fullpath); */ |
|
843 |
if (stat(fullpath, &fstat)) |
if (stat(fullpath, &fstat)) |
844 |
{ |
{ |
845 |
perror("stat"); |
switch (errno) |
846 |
out_uint8(out, 0); |
{ |
847 |
return STATUS_ACCESS_DENIED; |
case ENOENT: |
848 |
|
case ELOOP: |
849 |
|
case EACCES: |
850 |
|
/* These are non-fatal errors. */ |
851 |
|
memset(&fstat, 0, sizeof(fstat)); |
852 |
|
break; |
853 |
|
default: |
854 |
|
/* Fatal error. By returning STATUS_NO_SUCH_FILE, |
855 |
|
the directory list operation will be aborted */ |
856 |
|
perror(fullpath); |
857 |
|
out_uint8(out, 0); |
858 |
|
return STATUS_NO_SUCH_FILE; |
859 |
|
} |
860 |
} |
} |
861 |
|
|
862 |
if (S_ISDIR(fstat.st_mode)) |
if (S_ISDIR(fstat.st_mode)) |