#include "config.h"
#endif
+#ifdef AROS
+#include "aros_compat.h"
+#endif
+
#ifdef WIN32
#include "win32_compat.h"
#pragma comment(lib, "ws2_32.lib")
WSADATA wsaData;
+#define PRId64 "ll"
#else
+#include <inttypes.h>
#include <string.h>
#include <sys/stat.h>
#ifndef AROS
#include <unistd.h>
#endif
-#ifdef AROS
-#include "aros_compat.h"
-#endif
-
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
-#include <inttypes.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
ret = nfs_opendir(nfs, "/", &nfsdir);
if (ret != 0) {
- printf("Failed to opendir(\"/\")\n", nfs_get_error(nfs));
+ printf("Failed to opendir(\"/\") %s\n", nfs_get_error(nfs));
exit(10);
}
while((nfsdirent = nfs_readdir(nfs, nfsdir)) != NULL) {
continue;
}
- snprintf(path, 1024, "%s/%s", "/", nfsdirent->name);
+ sprintf(path, "%s/%s", "/", nfsdirent->name);
ret = nfs_stat(nfs, path, &st);
if (ret != 0) {
fprintf(stderr, "Failed to stat(%s) %s\n", path, nfs_get_error(nfs));
}
switch (st.st_mode & S_IFMT) {
+#ifndef WIN32
case S_IFLNK:
+#endif
case S_IFREG:
printf("-");
break;
"-w"[!!(st.st_mode & S_IWOTH)],
"-x"[!!(st.st_mode & S_IXOTH)]
);
- printf(" %2d", st.st_nlink);
+ printf(" %2d", (int)st.st_nlink);
printf(" %5d", st.st_uid);
printf(" %5d", st.st_gid);
printf(" %12" PRId64, st.st_size);