summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2010-06-16 17:25:40 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2010-06-16 17:25:40 +0000
commit6d537a3342f7b6559c73bd0c9a0854f0dfe3faa4 (patch)
tree8e2ac304e922975a7c75b4afc09b9b806b775a15 /cpukit
parent2010-06-16 Joel Sherrill <joel.sherrilL@OARcorp.com> (diff)
downloadrtems-6d537a3342f7b6559c73bd0c9a0854f0dfe3faa4.tar.bz2
2010-06-16 Ralf Corsépius <ralf.corsepius@rtems.org>
* libfs/src/rfs/rtems-rfs-rtems.c: Various 64bit fixes. Add PRIomode_t.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/ChangeLog2
-rw-r--r--cpukit/libfs/src/rfs/rtems-rfs-rtems.c43
2 files changed, 28 insertions, 17 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index f429ded70a..abaf1b14b7 100644
--- a/cpukit/ChangeLog
+++ b/cpukit/ChangeLog
@@ -1,5 +1,7 @@
2010-06-16 Ralf Corsépius <ralf.corsepius@rtems.org>
+ * libfs/src/rfs/rtems-rfs-rtems.c: Various 64bit fixes.
+ Add PRIomode_t.
* libfs/src/rfs/rtems-rfs-buffer-bdbuf.c:
Various 64bit fixes.
diff --git a/cpukit/libfs/src/rfs/rtems-rfs-rtems.c b/cpukit/libfs/src/rfs/rtems-rfs-rtems.c
index afa68d415d..3afa351302 100644
--- a/cpukit/libfs/src/rfs/rtems-rfs-rtems.c
+++ b/cpukit/libfs/src/rfs/rtems-rfs-rtems.c
@@ -19,8 +19,17 @@
#include "config.h"
#endif
+#include <inttypes.h>
#include <stdlib.h>
+#if SIZEOF_MODE_T == 8
+#define PRIomode_t PRIo64
+#elif SIZEOF_MODE_T == 4
+#define PRIomode_t PRIo32
+#else
+#error "unsupport size of mode_t"
+#endif
+
#include <rtems/rfs/rtems-rfs-file.h>
#include <rtems/rfs/rtems-rfs-dir.h>
#include <rtems/rfs/rtems-rfs-link.h>
@@ -72,7 +81,7 @@ rtems_rfs_rtems_eval_path (const char* path,
int rc;
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_EVAL_PATH))
- printf ("rtems-rfs-rtems: eval-path: in: path:%s pathlen:%zi ino:%ld\n",
+ printf ("rtems-rfs-rtems: eval-path: in: path:%s pathlen:%zi ino:%" PRId32 "\n",
path, pathlen, ino);
/*
@@ -179,7 +188,7 @@ rtems_rfs_rtems_eval_path (const char* path,
return rtems_rfs_rtems_error ("eval_path: read parent inode", rc);
}
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_EVAL_PATH))
- printf("rtems-rfs-rtems: eval-path: parent: ino:%ld\n", ino);
+ printf("rtems-rfs-rtems: eval-path: parent: ino:%" PRId32 "\n", ino);
}
else
{
@@ -197,7 +206,7 @@ rtems_rfs_rtems_eval_path (const char* path,
return ((errno = rc) == 0) ? 0 : -1;
}
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_EVAL_PATH))
- printf("rtems-rfs-rtems: eval-path: down: path:%s ino:%ld\n", node, ino);
+ printf("rtems-rfs-rtems: eval-path: down: path:%s ino:%" PRId32 "\n", node, ino);
}
rc = rtems_rfs_inode_close (fs, &inode);
@@ -218,7 +227,7 @@ rtems_rfs_rtems_eval_path (const char* path,
rtems_rfs_rtems_unlock (fs);
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_EVAL_PATH))
- printf("rtems-rfs-rtems: eval-path: ino:%ld\n", ino);
+ printf("rtems-rfs-rtems: eval-path: ino:%" PRId32 "\n", ino);
return rc;
}
@@ -250,7 +259,7 @@ rtems_rfs_rtems_eval_for_make (const char* path,
int rc;
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_EVAL_FOR_MAKE))
- printf ("rtems-rfs-rtems: eval-for-make: path:%s ino:%ld\n", path, ino);
+ printf ("rtems-rfs-rtems: eval-for-make: path:%s ino:%" PRId32 "\n", path, ino);
*name = path + strlen (path);
@@ -377,7 +386,7 @@ rtems_rfs_rtems_eval_for_make (const char* path,
return rtems_rfs_rtems_error ("eval_for_make: read parent inode", rc);
}
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_EVAL_FOR_MAKE))
- printf ("rtems-rfs-rtems: eval-for-make: parent: ino:%ld\n", ino);
+ printf ("rtems-rfs-rtems: eval-for-make: parent: ino:%" PRId32 "\n", ino);
}
else
{
@@ -393,7 +402,7 @@ rtems_rfs_rtems_eval_for_make (const char* path,
return rtems_rfs_rtems_error ("eval_for_make: reading inode", rc);
}
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_EVAL_FOR_MAKE))
- printf("rtems-rfs-rtems: eval-for-make: down: path:%s ino:%ld\n",
+ printf("rtems-rfs-rtems: eval-for-make: down: path:%s ino:%" PRId32 "\n",
node, ino);
}
@@ -448,7 +457,7 @@ rtems_rfs_rtems_eval_for_make (const char* path,
rc = rtems_rfs_rtems_set_handlers (pathloc, &inode) ? 0 : EIO;
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_EVAL_FOR_MAKE))
- printf("rtems-rfs-rtems: eval-for-make: parent ino:%ld name:%s\n",
+ printf("rtems-rfs-rtems: eval-for-make: parent ino:%" PRId32 " name:%s\n",
ino, *name);
rtems_rfs_inode_close (fs, &inode);
@@ -477,7 +486,7 @@ rtems_rfs_rtems_link (rtems_filesystem_location_info_t* to_loc,
int rc;
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_LINK))
- printf ("rtems-rfs-rtems: link: in: parent:%ld target:%ld\n",
+ printf ("rtems-rfs-rtems: link: in: parent:%" PRId32 " target:%" PRId32 "\n",
parent, target);
rtems_rfs_rtems_lock (fs);
@@ -515,7 +524,7 @@ rtems_rfs_rtems_unlink (rtems_filesystem_location_info_t* parent_loc,
rtems_rfs_rtems_lock (fs);
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_UNLINK))
- printf("rtems-rfs-rtems: unlink: parent:%ld doff:%lu ino:%ld\n",
+ printf("rtems-rfs-rtems: unlink: parent:%" PRId32 " doff:%" PRIu32 " ino:%" PRId32 "\n",
parent, doff, ino);
rc = rtems_rfs_unlink (fs, parent, ino, doff, rtems_rfs_unlink_dir_denied);
@@ -611,7 +620,7 @@ rtems_rfs_rtems_chown (rtems_filesystem_location_info_t *pathloc,
int rc;
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_CHOWN))
- printf ("rtems-rfs-rtems: chown: in: ino:%ld uid:%d gid:%d\n",
+ printf ("rtems-rfs-rtems: chown: in: ino:%" PRId32 " uid:%d gid:%d\n",
ino, owner, group);
rtems_rfs_rtems_lock (fs);
@@ -775,7 +784,7 @@ rtems_rfs_rtems_readlink (rtems_filesystem_location_info_t* pathloc,
int rc;
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_READLINK))
- printf ("rtems-rfs-rtems: readlink: in: ino:%ld\n", ino);
+ printf ("rtems-rfs-rtems: readlink: in: ino:%" PRId32 "\n", ino);
rtems_rfs_rtems_lock (fs);
@@ -812,8 +821,8 @@ rtems_rfs_rtems_fchmod (rtems_filesystem_location_info_t* pathloc,
int rc;
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FCHMOD))
- printf ("rtems-rfs-rtems: fchmod: in: ino:%ld mode:%06o\n",
- ino, (unsigned int) mode);
+ printf ("rtems-rfs-rtems: fchmod: in: ino:%" PRId32 " mode:%06" PRIomode_t "\n",
+ ino, mode);
rtems_rfs_rtems_lock (fs);
@@ -892,7 +901,7 @@ rtems_rfs_rtems_stat (rtems_filesystem_location_info_t* pathloc,
int rc;
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_STAT))
- printf ("rtems-rfs-rtems: stat: in: ino:%ld\n", ino);
+ printf ("rtems-rfs-rtems: stat: in: ino:%" PRId32 "\n", ino);
rtems_rfs_rtems_lock (fs);
@@ -1060,7 +1069,7 @@ rtems_rfs_rtems_rmnod (rtems_filesystem_location_info_t* parent_pathloc,
int rc;
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_RMNOD))
- printf ("rtems-rfs: rmnod: parent:%ld doff:%lu, ino:%ld\n",
+ printf ("rtems-rfs: rmnod: parent:%" PRId32 " doff:%" PRIu32 ", ino:%" PRId32 "\n",
parent, doff, ino);
rtems_rfs_rtems_lock (fs);
@@ -1124,7 +1133,7 @@ rtems_rfs_rtems_rename(rtems_filesystem_location_info_t* old_parent_loc,
doff = rtems_rfs_rtems_get_pathloc_doff (old_loc);
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_RENAME))
- printf ("rtems-rfs: rename: ino:%ld doff:%lu, new parent:%ld new name:%s\n",
+ printf ("rtems-rfs: rename: ino:%" PRId32 " doff:%" PRIu32 ", new parent:%" PRId32 " new name:%s\n",
ino, doff, new_parent, new_name);
rtems_rfs_rtems_lock (fs);