<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>change log for rtems (2010-10-11)</title>
</head>
<body text='#000000' bgcolor='#ffffff'>
<a name='cs1'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
<font color='#bb2222'><strong>ccj</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2010-10-11 Chris Johns <chrisj@rtems.org>
* libfs/src/rfs/rtems-rfs-trace.c,
libfs/src/rfs/rtems-rfs-trace.h: Add inode-delete.
* libfs/src/rfs/rtems-rfs-shell.c: Fix formatting.
* libfs/src/rfs/rtems-rfs-rtems-dir.c: Use ssize_t. Fix spelling.
* libfs/src/rfs/rtems-rfs-block.c: Fix rtems_rfs_block_get_bpos to
return the position correctly. A bpos does not have any special
processing. Do no reset the buffer handle when shrinking
indirectly.
* libfs/src/rfs/rtems-rfs-inode.c: Add trace.
* libfs/src/rfs/rtems-rfs-format.c: Fix comments.
* libfs/src/rfs/rtems-rfs-group.c: Limit the inodes to the blocks
in a group so the accounting works.
* libfs/src/rfs/rtems-rfs-dir.c: PR 1705. Fix handling the offsets
when deleting an entry.
* libfs/src/rfs/rtems-rfs-buffer.h: Remove
rtems_rfs_buffer_handle_reset. It is not needed and dangerous.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/ChangeLog.diff?r1=text&tr1=1.2633&r2=text&tr2=1.2634&diff_format=h">M</a></td><td width='1%'>1.2634</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libfs/src/rfs/rtems-rfs-block.c.diff?r1=text&tr1=1.6&r2=text&tr2=1.7&diff_format=h">M</a></td><td width='1%'>1.7</td><td width='100%'>cpukit/libfs/src/rfs/rtems-rfs-block.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libfs/src/rfs/rtems-rfs-buffer.h.diff?r1=text&tr1=1.3&r2=text&tr2=1.4&diff_format=h">M</a></td><td width='1%'>1.4</td><td width='100%'>cpukit/libfs/src/rfs/rtems-rfs-buffer.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libfs/src/rfs/rtems-rfs-dir.c.diff?r1=text&tr1=1.7&r2=text&tr2=1.8&diff_format=h">M</a></td><td width='1%'>1.8</td><td width='100%'>cpukit/libfs/src/rfs/rtems-rfs-dir.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libfs/src/rfs/rtems-rfs-format.c.diff?r1=text&tr1=1.7&r2=text&tr2=1.8&diff_format=h">M</a></td><td width='1%'>1.8</td><td width='100%'>cpukit/libfs/src/rfs/rtems-rfs-format.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libfs/src/rfs/rtems-rfs-group.c.diff?r1=text&tr1=1.5&r2=text&tr2=1.6&diff_format=h">M</a></td><td width='1%'>1.6</td><td width='100%'>cpukit/libfs/src/rfs/rtems-rfs-group.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libfs/src/rfs/rtems-rfs-inode.c.diff?r1=text&tr1=1.4&r2=text&tr2=1.5&diff_format=h">M</a></td><td width='1%'>1.5</td><td width='100%'>cpukit/libfs/src/rfs/rtems-rfs-inode.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems-dir.c.diff?r1=text&tr1=1.6&r2=text&tr2=1.7&diff_format=h">M</a></td><td width='1%'>1.7</td><td width='100%'>cpukit/libfs/src/rfs/rtems-rfs-rtems-dir.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libfs/src/rfs/rtems-rfs-shell.c.diff?r1=text&tr1=1.10&r2=text&tr2=1.11&diff_format=h">M</a></td><td width='1%'>1.11</td><td width='100%'>cpukit/libfs/src/rfs/rtems-rfs-shell.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libfs/src/rfs/rtems-rfs-trace.h.diff?r1=text&tr1=1.1&r2=text&tr2=1.2&diff_format=h">M</a></td><td width='1%'>1.2</td><td width='100%'>cpukit/libfs/src/rfs/rtems-rfs-trace.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libfs/src/rfs/rtems-rfs-trace.c.diff?r1=text&tr1=1.2&r2=text&tr2=1.3&diff_format=h">M</a></td><td width='1%'>1.3</td><td width='100%'>cpukit/libfs/src/rfs/rtems-rfs-trace.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.2633 rtems/cpukit/ChangeLog:1.2634
--- rtems/cpukit/ChangeLog:1.2633 Fri Oct 8 04:44:44 2010
+++ rtems/cpukit/ChangeLog Sun Oct 10 23:34:48 2010
</font><font color='#997700'>@@ -1,3 +1,22 @@
</font><font color='#000088'>+2010-10-11 Chris Johns <chrisj@rtems.org>
+
+ * libfs/src/rfs/rtems-rfs-trace.c,
+ libfs/src/rfs/rtems-rfs-trace.h: Add inode-delete.
+ * libfs/src/rfs/rtems-rfs-shell.c: Fix formatting.
+ * libfs/src/rfs/rtems-rfs-rtems-dir.c: Use ssize_t. Fix spelling.<span style="background-color: #FF0000"> </span>
+ * libfs/src/rfs/rtems-rfs-block.c: Fix rtems_rfs_block_get_bpos to
+ return the position correctly. A bpos does not have any special
+ processing. Do no reset the buffer handle when shrinking
+ indirectly.
+ * libfs/src/rfs/rtems-rfs-inode.c: Add trace.
+ * libfs/src/rfs/rtems-rfs-format.c: Fix comments.
+ * libfs/src/rfs/rtems-rfs-group.c: Limit the inodes to the blocks
+ in a group so the accounting works.
+ * libfs/src/rfs/rtems-rfs-dir.c: PR 1705. Fix handling the offsets
+ when deleting an entry.
+ * libfs/src/rfs/rtems-rfs-buffer.h: Remove
+ rtems_rfs_buffer_handle_reset. It is not needed and dangerous.
+
</font> 2010-10-08 Ralf Corsépius <ralf.corsepius@rtems.org>
* configure.ac: pthread_attr* functions are in <pthread.h>, not in
<font color='#006600'>diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-block.c:1.6 rtems/cpukit/libfs/src/rfs/rtems-rfs-block.c:1.7
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-block.c:1.6 Thu Jun 17 17:04:51 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-block.c Sun Oct 10 23:34:48 2010
</font><font color='#997700'>@@ -46,33 +46,25 @@
</font> #include <rtems/rfs/rtems-rfs-inode.h>
void
<font color='#880000'>-rtems_rfs_block_get_bpos (rtems_rfs_file_system* fs,
- rtems_rfs_pos pos,
- rtems_rfs_block_pos* bpos)
</font><font color='#000088'>+rtems_rfs_block_get_bpos (rtems_rfs_file_system* fs,
+ rtems_rfs_pos pos,
+ rtems_rfs_block_pos* bpos)
</font> {
bpos->bno = pos / rtems_rfs_fs_block_size (fs);
bpos->boff = pos % rtems_rfs_fs_block_size (fs);
}
rtems_rfs_pos
<font color='#880000'>-rtems_rfs_block_get_pos (rtems_rfs_file_system* fs,
- rtems_rfs_block_pos* bpos)
</font><font color='#000088'>+rtems_rfs_block_get_pos (rtems_rfs_file_system* fs,
+ rtems_rfs_block_pos* bpos)
</font> {
<font color='#880000'>- rtems_rfs_pos pos = 0;
- if (bpos->bno)
- {
- pos = bpos->boff;
- if (pos == 0)
- pos = rtems_rfs_fs_block_size (fs);
- pos += (bpos->bno - 1) * rtems_rfs_fs_block_size (fs);
- }
- return pos;
</font><font color='#000088'>+ return (bpos->bno * rtems_rfs_fs_block_size (fs)) + bpos->boff;
</font> }
void
<font color='#880000'>-rtems_rfs_block_get_block_size (rtems_rfs_file_system* fs,
- rtems_rfs_pos pos,
- rtems_rfs_block_size* size)
</font><font color='#000088'>+rtems_rfs_block_get_block_size (rtems_rfs_file_system* fs,
+ rtems_rfs_pos pos,
+ rtems_rfs_block_size* size)
</font> {
if (pos == 0)
rtems_rfs_block_set_size_zero (size);
<font color='#997700'>@@ -634,8 +626,6 @@
</font> int b;
for (b = 0; b < RTEMS_RFS_INODE_BLOCKS; b++)
map->blocks[b] = rtems_rfs_block_get_number (buffer, b);
<font color='#880000'>-
- rtems_rfs_buffer_handle_reset (buffer);
</font> }
else
{
<font color='#006600'>diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-buffer.h:1.3 rtems/cpukit/libfs/src/rfs/rtems-rfs-buffer.h:1.4
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-buffer.h:1.3 Wed Jun 16 09:39:14 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-buffer.h Sun Oct 10 23:34:48 2010
</font><font color='#997700'>@@ -186,22 +186,6 @@
</font> rtems_rfs_buffer_handle* handle);
/**
<font color='#880000'>- * Reset a handle.
- *
- * @param fs The file system data.
- * @param handle The buffer handle to reset.
- * @return int The error number (errno). No error if 0.
- */
-static inline int
-rtems_rfs_buffer_handle_reset (rtems_rfs_buffer_handle* handle)
-{
- handle->dirty = false;
- handle->bnum = 0;<span style="background-color: #FF0000"> </span>
- handle->buffer = NULL;
- return 0;
-}
-
-/**
</font> * Open a handle.
*
* @param fs The file system data.
<font color='#997700'>@@ -212,7 +196,9 @@
</font> rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
<font color='#880000'>- rtems_rfs_buffer_handle_reset (handle);
</font><font color='#000088'>+ handle->dirty = false;
+ handle->bnum = 0;<span style="background-color: #FF0000"> </span>
+ handle->buffer = NULL;
</font> return 0;
}
<font color='#997700'>@@ -228,6 +214,9 @@
</font> rtems_rfs_buffer_handle* handle)
{
rtems_rfs_buffer_handle_release (fs, handle);
<font color='#000088'>+ handle->dirty = false;
+ handle->bnum = 0;<span style="background-color: #FF0000"> </span>
+ handle->buffer = NULL;
</font> return 0;
}
<font color='#006600'>diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-dir.c:1.7 rtems/cpukit/libfs/src/rfs/rtems-rfs-dir.c:1.8
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-dir.c:1.7 Tue Jun 15 18:34:56 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-dir.c Sun Oct 10 23:34:48 2010
</font><font color='#997700'>@@ -127,6 +127,10 @@
</font> {
uint8_t* entry;
<font color='#000088'>+ if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
+ printf ("rtems-rfs: dir-lookup-ino: block read, ino=%" PRIu32 " bno=%" PRId32 "\n",
+ rtems_rfs_inode_ino (inode), map.bpos.bno);
+<span style="background-color: #FF0000"> </span>
</font> rc = rtems_rfs_buffer_handle_request (fs, &entries, block, true);<span style="background-color: #FF0000"> </span>
if (rc > 0)
{
<font color='#997700'>@@ -171,8 +175,9 @@
</font> {
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO_CHECK))
printf ("rtems-rfs: dir-lookup-ino: "
<font color='#880000'>- "checking entry for ino %" PRId32 ": off=%04" PRIx32 " length:%d ino:%" PRId32 "\n",
- rtems_rfs_inode_ino (inode), map.bpos.boff,
</font><font color='#000088'>+ "checking entry for ino %" PRId32 ": bno=%04" PRIx32 "/off=%04" PRIx32
+ " length:%d ino:%" PRId32 "\n",
+ rtems_rfs_inode_ino (inode), map.bpos.bno, map.bpos.boff,
</font> elength, rtems_rfs_dir_entry_ino (entry));
if (memcmp (entry + RTEMS_RFS_DIR_ENTRY_SIZE, name, length) == 0)
<font color='#997700'>@@ -414,7 +419,7 @@
</font> while (rc == 0)
{
uint8_t* entry;
<font color='#880000'>- int offset;
</font><font color='#000088'>+ int eoffset;
</font>
rc = rtems_rfs_buffer_handle_request (fs, &buffer, block, true);
if (rc > 0)
<font color='#997700'>@@ -425,11 +430,19 @@
</font> rtems_rfs_inode_ino (dir), rc, strerror (rc));
break;
}
<font color='#000088'>+
+ /*
+ * If we are searching start at the beginning of the block. If not searching
+ * skip to the offset in the block.
+ */
+ if (search)
+ eoffset = 0;
+ else
+ eoffset = offset % rtems_rfs_fs_block_size (fs);
</font>
<font color='#880000'>- entry = rtems_rfs_buffer_data (&buffer);
- offset = 0;
</font><font color='#000088'>+ entry = rtems_rfs_buffer_data (&buffer) + eoffset;
</font>
<font color='#880000'>- while (offset < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
</font><font color='#000088'>+ while (eoffset < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
</font> {
rtems_rfs_ino eino;
int elength;
<font color='#997700'>@@ -444,8 +457,9 @@
</font> {
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_DEL_ENTRY))
printf ("rtems-rfs: dir-del-entry: "
<font color='#880000'>- "bad length or ino for ino %" PRIu32 ": %u/%" PRId32 " @ %04x\n",
- rtems_rfs_inode_ino (dir), elength, eino, offset);
</font><font color='#000088'>+ "bad length or ino for ino %" PRIu32 ": %u/%" PRId32
+ " @ %" PRIu32 ".%04x\n",
+ rtems_rfs_inode_ino (dir), elength, eino, block, eoffset);
</font> rc = EIO;
break;
}
<font color='#997700'>@@ -453,7 +467,7 @@
</font> if (ino == rtems_rfs_dir_entry_ino (entry))
{
uint32_t remaining;
<font color='#880000'>- remaining = rtems_rfs_fs_block_size (fs) - (offset + elength);
</font><font color='#000088'>+ remaining = rtems_rfs_fs_block_size (fs) - (eoffset + elength);
</font> memmove (entry, entry + elength, remaining);
memset (entry + remaining, 0xff, elength);
<font color='#997700'>@@ -468,12 +482,13 @@
</font>
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_DEL_ENTRY))
printf ("rtems-rfs: dir-del-entry: "
<font color='#880000'>- "last block free for ino %" PRIu32 ": elength=%i offset=%d last=%s\n",
- ino, elength, offset,
</font><font color='#000088'>+ "last block free for ino %" PRIu32 ": elength=%i block=%" PRIu32
+ " offset=%d last=%s\n",
+ ino, elength, block, eoffset,
</font> rtems_rfs_block_map_last (&map) ? "yes" : "no");
if ((elength == RTEMS_RFS_DIR_ENTRY_EMPTY) &&
<font color='#880000'>- (offset == 0) && rtems_rfs_block_map_last (&map))
</font><font color='#000088'>+ (eoffset == 0) && rtems_rfs_block_map_last (&map))
</font> {
rc = rtems_rfs_block_map_shrink (fs, &map, 1);
if (rc > 0)
<font color='#997700'>@@ -497,8 +512,8 @@
</font> break;
}
<font color='#880000'>- entry += elength;
- offset += elength;
</font><font color='#000088'>+ entry += elength;
+ eoffset += elength;
</font> }
if (rc == 0)
<font color='#997700'>@@ -605,10 +620,7 @@
</font> if (remaining <= RTEMS_RFS_DIR_ENTRY_SIZE)
*length += remaining;
<font color='#880000'>- if (elength < RTEMS_RFS_DIR_ENTRY_SIZE)
- elength = 0;
- else
- elength -= RTEMS_RFS_DIR_ENTRY_SIZE;
</font><font color='#000088'>+ elength -= RTEMS_RFS_DIR_ENTRY_SIZE;
</font> if (elength > NAME_MAX)
elength = NAME_MAX;
<font color='#006600'>diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-format.c:1.7 rtems/cpukit/libfs/src/rfs/rtems-rfs-format.c:1.8
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-format.c:1.7 Thu Aug 26 01:31:15 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-format.c Sun Oct 10 23:34:48 2010
</font><font color='#997700'>@@ -84,8 +84,7 @@
</font> rtems_rfs_fs_block_size (fs));
bits_per_block = rtems_rfs_bits_per_block (fs);
/*
<font color='#880000'>- * There could be more bits that there are blocks, eg 512K disk with 512
- * blocks.
</font><font color='#000088'>+ * There could be more bits than blocks, eg 512K disk with 512 blocks.
</font> */
if (bits_per_block > (rtems_rfs_fs_blocks (fs) - RTEMS_RFS_SUPERBLOCK_SIZE))
bits_per_block = rtems_rfs_fs_blocks (fs) - RTEMS_RFS_SUPERBLOCK_SIZE;
<font color='#997700'>@@ -353,7 +352,7 @@
</font> rtems_rfs_buffer_mark_dirty (&handle);
/*
<font color='#880000'>- * Initialise the inode tables if rerquired to do so.
</font><font color='#000088'>+ * Initialise the inode tables if required to do so.
</font> */
if (initialise_inodes)
{
<font color='#006600'>diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-group.c:1.5 rtems/cpukit/libfs/src/rfs/rtems-rfs-group.c:1.6
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-group.c:1.5 Wed Jun 16 21:44:49 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-group.c Sun Oct 10 23:34:48 2010
</font><font color='#997700'>@@ -46,6 +46,15 @@
</font>
if ((base + size) >= rtems_rfs_fs_blocks (fs))
size = rtems_rfs_fs_blocks (fs) - base;
<font color='#000088'>+
+ /*
+ * Limit the inodes to the same size as the blocks. This is what the
+ * format does and if this is not done the accounting of inodes does
+ * not work. If we are so pushed for inodes that this makes a difference
+ * the format configuration needs reviewing.
+ */
+ if (inodes > size)
+ inodes = size;
</font>
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_OPEN))
printf ("rtems-rfs: group-open: base=%" PRId32 ", blocks=%zd inodes=%zd\n",
<font color='#006600'>diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-inode.c:1.4 rtems/cpukit/libfs/src/rfs/rtems-rfs-inode.c:1.5
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-inode.c:1.4 Wed Jun 16 12:30:35 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-inode.c Sun Oct 10 23:34:48 2010
</font><font color='#997700'>@@ -296,6 +296,12 @@
</font> rtems_rfs_inode_handle* handle)
{
int rc = 0;
<font color='#000088'>+<span style="background-color: #FF0000"> </span>
+ if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_DELETE))
+ printf("rtems-rfs: inode-delete: ino:%" PRIu32 " loaded:%s\n",
+ rtems_rfs_inode_ino (handle),
+ rtems_rfs_inode_is_loaded (handle) ? "yes" : "no");
+
</font> if (rtems_rfs_inode_is_loaded (handle))
{
rtems_rfs_block_map map;
<font color='#006600'>diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems-dir.c:1.6 rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems-dir.c:1.7
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems-dir.c:1.6 Wed Aug 25 04:37:49 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems-dir.c Sun Oct 10 23:34:48 2010
</font><font color='#997700'>@@ -26,6 +26,7 @@
</font> #include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
<font color='#000088'>+#include <unistd.h>
</font>
#include <rtems/rfs/rtems-rfs-dir.h>
#include <rtems/rfs/rtems-rfs-link.h>
<font color='#997700'>@@ -113,7 +114,7 @@
</font> rtems_rfs_ino ino = rtems_rfs_rtems_get_iop_ino (iop);
rtems_rfs_inode_handle inode;
struct dirent* dirent;
<font color='#880000'>- size_t bytes_transfered;
</font><font color='#000088'>+ ssize_t bytes_transferred;
</font> int d;
int rc;
<font color='#997700'>@@ -129,7 +130,7 @@
</font> return rtems_rfs_rtems_error ("dir_read: read inode", rc);
}
<font color='#880000'>- bytes_transfered = 0;
</font><font color='#000088'>+ bytes_transferred = 0;
</font>
for (d = 0; d < count; d++, dirent++)
{
<font color='#997700'>@@ -142,17 +143,17 @@
</font> }
if (rc > 0)
{
<font color='#880000'>- bytes_transfered = rtems_rfs_rtems_error ("dir_read: dir read", rc);
</font><font color='#000088'>+ bytes_transferred = rtems_rfs_rtems_error ("dir_read: dir read", rc);
</font> break;
}
iop->offset += size;
<font color='#880000'>- bytes_transfered += sizeof (struct dirent);
</font><font color='#000088'>+ bytes_transferred += sizeof (struct dirent);
</font> }
rtems_rfs_inode_close (fs, &inode);
rtems_rfs_rtems_unlock (fs);
<font color='#880000'>- return (ssize_t) bytes_transfered;
</font><font color='#000088'>+ return bytes_transferred;
</font> }
/**
<font color='#006600'>diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-shell.c:1.10 rtems/cpukit/libfs/src/rfs/rtems-rfs-shell.c:1.11
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-shell.c:1.10 Thu Jun 24 08:28:39 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-shell.c Sun Oct 10 23:34:48 2010
</font><font color='#997700'>@@ -123,24 +123,24 @@
</font> printf ("RFS Filesystem Data\n");
printf (" flags: %08" PRIx32 "\n", fs->flags);
#if 0
<font color='#880000'>- printf (" device: %08lx\n", rtems_rfs_fs_device (fs));
</font><font color='#000088'>+ printf (" device: %08lx\n", rtems_rfs_fs_device (fs));
</font> #endif
<font color='#880000'>- printf (" blocks: %zu\n", rtems_rfs_fs_blocks (fs));
- printf (" block size: %zu\n", rtems_rfs_fs_block_size (fs));
- printf (" size: %" PRIu64 "\n", rtems_rfs_fs_size (fs));
- printf (" media block size: %" PRIu32 "\n", rtems_rfs_fs_media_block_size (fs));
- printf (" media size: %" PRIu64 "\n", rtems_rfs_fs_media_size (fs));
- printf (" inodes: %" PRIu32 "\n", rtems_rfs_fs_inodes (fs));
- printf (" bad blocks: %" PRIu32 "\n", fs->bad_blocks);
- printf (" max. name length: %" PRIu32 "\n", rtems_rfs_fs_max_name (fs));
- printf (" groups: %d\n", fs->group_count);
- printf (" group blocks: %zd\n", fs->group_blocks);
- printf (" group inodes: %zd\n", fs->group_inodes);
- printf (" inodes per block: %zd\n", fs->inodes_per_block);
- printf (" blocks per block: %zd\n", fs->blocks_per_block);
- printf (" singly blocks: %zd\n", fs->block_map_singly_blocks);
- printf (" doublly blocks: %zd\n", fs->block_map_doubly_blocks);
- printf (" max. held buffers: %" PRId32 "\n", fs->max_held_buffers);
</font><font color='#000088'>+ printf (" blocks: %zu\n", rtems_rfs_fs_blocks (fs));
+ printf (" block size: %zu\n", rtems_rfs_fs_block_size (fs));
+ printf (" size: %" PRIu64 "\n", rtems_rfs_fs_size (fs));
+ printf (" media block size: %" PRIu32 "\n", rtems_rfs_fs_media_block_size (fs));
+ printf (" media size: %" PRIu64 "\n", rtems_rfs_fs_media_size (fs));
+ printf (" inodes: %" PRIu32 "\n", rtems_rfs_fs_inodes (fs));
+ printf (" bad blocks: %" PRIu32 "\n", fs->bad_blocks);
+ printf (" max. name length: %" PRIu32 "\n", rtems_rfs_fs_max_name (fs));
+ printf (" groups: %d\n", fs->group_count);
+ printf (" group blocks: %zd\n", fs->group_blocks);
+ printf (" group inodes: %zd\n", fs->group_inodes);
+ printf (" inodes per block: %zd\n", fs->inodes_per_block);
+ printf (" blocks per block: %zd\n", fs->blocks_per_block);
+ printf (" singly blocks: %zd\n", fs->block_map_singly_blocks);
+ printf (" doublly blocks: %zd\n", fs->block_map_doubly_blocks);
+ printf (" max. held buffers: %" PRId32 "\n", fs->max_held_buffers);
</font>
rtems_rfs_shell_lock_rfs (fs);
<font color='#997700'>@@ -302,8 +302,7 @@
</font> }
}
<font color='#880000'>- if ((start < 0) || (end < 0) ||
- (start >= total) || (end >= total))
</font><font color='#000088'>+ if ((start >= total) || (end >= total))
</font> {
printf ("error: inode out of range (0->%" PRId32 ").\n", total - 1);
return 1;
<font color='#006600'>diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-trace.h:1.1 rtems/cpukit/libfs/src/rfs/rtems-rfs-trace.h:1.2
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-trace.h:1.1 Wed Feb 17 18:24:25 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-trace.h Sun Oct 10 23:34:48 2010
</font><font color='#997700'>@@ -28,7 +28,9 @@
</font> /**
* Is tracing enabled ?
*/
<font color='#880000'>-#define RTEMS_RFS_TRACE 0
</font><font color='#000088'>+#if !defined (RTEMS_RFS_TRACE)
+#define RTEMS_RFS_TRACE 1
+#endif
</font>
/**
* The type of the mask.
<font color='#997700'>@@ -62,21 +64,22 @@
</font> #define RTEMS_RFS_TRACE_INODE_LOAD (1ULL << 20)
#define RTEMS_RFS_TRACE_INODE_UNLOAD (1ULL << 21)
#define RTEMS_RFS_TRACE_INODE_CREATE (1ULL << 22)
<font color='#880000'>-#define RTEMS_RFS_TRACE_LINK (1ULL << 23)
-#define RTEMS_RFS_TRACE_UNLINK (1ULL << 24)
-#define RTEMS_RFS_TRACE_DIR_LOOKUP_INO (1ULL << 25)
-#define RTEMS_RFS_TRACE_DIR_LOOKUP_INO_CHECK (1ULL << 26)
-#define RTEMS_RFS_TRACE_DIR_LOOKUP_INO_FOUND (1ULL << 27)
-#define RTEMS_RFS_TRACE_DIR_ADD_ENTRY (1ULL << 28)
-#define RTEMS_RFS_TRACE_DIR_DEL_ENTRY (1ULL << 29)
-#define RTEMS_RFS_TRACE_DIR_READ (1ULL << 30)
-#define RTEMS_RFS_TRACE_DIR_EMPTY (1ULL << 31)
-#define RTEMS_RFS_TRACE_SYMLINK (1ULL << 32)
-#define RTEMS_RFS_TRACE_SYMLINK_READ (1ULL << 33)
-#define RTEMS_RFS_TRACE_FILE_OPEN (1ULL << 34)
-#define RTEMS_RFS_TRACE_FILE_CLOSE (1ULL << 35)
-#define RTEMS_RFS_TRACE_FILE_IO (1ULL << 36)
-#define RTEMS_RFS_TRACE_FILE_SET (1ULL << 37)
</font><font color='#000088'>+#define RTEMS_RFS_TRACE_INODE_DELETE (1ULL << 23)
+#define RTEMS_RFS_TRACE_LINK (1ULL << 24)
+#define RTEMS_RFS_TRACE_UNLINK (1ULL << 25)
+#define RTEMS_RFS_TRACE_DIR_LOOKUP_INO (1ULL << 26)
+#define RTEMS_RFS_TRACE_DIR_LOOKUP_INO_CHECK (1ULL << 27)
+#define RTEMS_RFS_TRACE_DIR_LOOKUP_INO_FOUND (1ULL << 28)
+#define RTEMS_RFS_TRACE_DIR_ADD_ENTRY (1ULL << 29)
+#define RTEMS_RFS_TRACE_DIR_DEL_ENTRY (1ULL << 30)
+#define RTEMS_RFS_TRACE_DIR_READ (1ULL << 31)
+#define RTEMS_RFS_TRACE_DIR_EMPTY (1ULL << 32)
+#define RTEMS_RFS_TRACE_SYMLINK (1ULL << 33)
+#define RTEMS_RFS_TRACE_SYMLINK_READ (1ULL << 34)
+#define RTEMS_RFS_TRACE_FILE_OPEN (1ULL << 35)
+#define RTEMS_RFS_TRACE_FILE_CLOSE (1ULL << 36)
+#define RTEMS_RFS_TRACE_FILE_IO (1ULL << 37)
+#define RTEMS_RFS_TRACE_FILE_SET (1ULL << 38)
</font>
/**
* Call to check if this part is bring traced. If RTEMS_RFS_TRACE is defined to
<font color='#006600'>diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-trace.c:1.2 rtems/cpukit/libfs/src/rfs/rtems-rfs-trace.c:1.3
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-trace.c:1.2 Fri Mar 26 23:04:40 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-trace.c Sun Oct 10 23:34:48 2010
</font><font color='#997700'>@@ -78,6 +78,7 @@
</font> "inode-load",
"inode-unload",
"inode-create",
<font color='#000088'>+ "inode-delete",
</font> "link",
"unlink",
"dir-lookup-ino",
</pre>
<p> </p>
<a name='cs2'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
<font color='#bb2222'><strong>ccj</strong></font>
<font color='#225522'><em>(on branch rtems-4-10-branch)</em></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2010-10-11 Chris Johns <chrisj@rtems.org>
* libfs/src/rfs/rtems-rfs-trace.c,
libfs/src/rfs/rtems-rfs-trace.h: Add inode-delete.
* libfs/src/rfs/rtems-rfs-shell.c: Fix formatting.
* libfs/src/rfs/rtems-rfs-rtems-dir.c: Use ssize_t. Fix
spelling.
* libfs/src/rfs/rtems-rfs-block.c: Fix
rtems_rfs_block_get_bpos to
return the position correctly. A bpos does not have any
special
processing. Do no reset the buffer handle when shrinking
indirectly.
* libfs/src/rfs/rtems-rfs-inode.c: Add trace.
* libfs/src/rfs/rtems-rfs-format.c: Fix comments.
* libfs/src/rfs/rtems-rfs-group.c: Limit the inodes to the
blocks
in a group so the accounting works.
* libfs/src/rfs/rtems-rfs-dir.c: PR 1705. Fix handling the
offsets
when deleting an entry.
* libfs/src/rfs/rtems-rfs-buffer.h: Remove
rtems_rfs_buffer_handle_reset. It is not needed and dangerous.
* cpukit/libmisc/untar/untar.c: Merge 4.11 pax fix. This fix also
supports MacOS's tar.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/ChangeLog.diff?r1=text&tr1=1.2346.2.69&r2=text&tr2=1.2346.2.70&diff_format=h">M</a></td><td width='1%'>1.2346.2.70</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libfs/src/rfs/rtems-rfs-block.c.diff?r1=text&tr1=1.4.2.2&r2=text&tr2=1.4.2.3&diff_format=h">M</a></td><td width='1%'>1.4.2.3</td><td width='100%'>cpukit/libfs/src/rfs/rtems-rfs-block.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libfs/src/rfs/rtems-rfs-dir.c.diff?r1=text&tr1=1.6.2.1&r2=text&tr2=1.6.2.2&diff_format=h">M</a></td><td width='1%'>1.6.2.2</td><td width='100%'>cpukit/libfs/src/rfs/rtems-rfs-dir.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libfs/src/rfs/rtems-rfs-trace.h.diff?r1=text&tr1=1.1&r2=text&tr2=1.1.2.1&diff_format=h">M</a></td><td width='1%'>1.1.2.1</td><td width='100%'>cpukit/libfs/src/rfs/rtems-rfs-trace.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libmisc/untar/untar.c.diff?r1=text&tr1=1.12&r2=text&tr2=1.12.6.1&diff_format=h">M</a></td><td width='1%'>1.12.6.1</td><td width='100%'>cpukit/libmisc/untar/untar.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.2346.2.69 rtems/cpukit/ChangeLog:1.2346.2.70
--- rtems/cpukit/ChangeLog:1.2346.2.69 Wed Sep 29 09:21:33 2010
+++ rtems/cpukit/ChangeLog Sun Oct 10 23:40:07 2010
</font><font color='#997700'>@@ -1,3 +1,29 @@
</font><font color='#000088'>+2010-10-11 Chris Johns <chrisj@rtems.org>
+
+ * libfs/src/rfs/rtems-rfs-trace.c,
+ libfs/src/rfs/rtems-rfs-trace.h: Add inode-delete.
+ * libfs/src/rfs/rtems-rfs-shell.c: Fix formatting.
+ * libfs/src/rfs/rtems-rfs-rtems-dir.c: Use ssize_t. Fix
+ spelling.
+ * libfs/src/rfs/rtems-rfs-block.c: Fix
+ rtems_rfs_block_get_bpos to
+ return the position correctly. A bpos does not have any
+ special
+ processing. Do no reset the buffer handle when shrinking
+ indirectly.
+ * libfs/src/rfs/rtems-rfs-inode.c: Add trace.
+ * libfs/src/rfs/rtems-rfs-format.c: Fix comments.
+ * libfs/src/rfs/rtems-rfs-group.c: Limit the inodes to the
+ blocks
+ in a group so the accounting works.
+ * libfs/src/rfs/rtems-rfs-dir.c: PR 1705. Fix handling the
+ offsets
+ when deleting an entry.
+ * libfs/src/rfs/rtems-rfs-buffer.h: Remove
+ rtems_rfs_buffer_handle_reset. It is not needed and dangerous.
+ * cpukit/libmisc/untar/untar.c: Merge 4.11 pax fix. This fix also
+ supports MacOS's tar.
+<span style="background-color: #FF0000"> </span>
</font> 2010-09-29 Ralf Corsépius <ralf.corsepius@rtems.org>
* automake/compile.am: Remove non release-suitable warning flags.
<font color='#006600'>diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-block.c:1.4.2.2 rtems/cpukit/libfs/src/rfs/rtems-rfs-block.c:1.4.2.3
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-block.c:1.4.2.2 Thu Jun 17 17:10:20 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-block.c Sun Oct 10 23:40:08 2010
</font><font color='#997700'>@@ -46,18 +46,19 @@
</font> #include <rtems/rfs/rtems-rfs-inode.h>
void
<font color='#880000'>-rtems_rfs_block_get_bpos (rtems_rfs_file_system* fs,
- rtems_rfs_pos pos,
- rtems_rfs_block_pos* bpos)
</font><font color='#000088'>+rtems_rfs_block_get_bpos (rtems_rfs_file_system* fs,
+ rtems_rfs_pos pos,
+ rtems_rfs_block_pos* bpos)
</font> {
bpos->bno = pos / rtems_rfs_fs_block_size (fs);
bpos->boff = pos % rtems_rfs_fs_block_size (fs);
}
rtems_rfs_pos
<font color='#880000'>-rtems_rfs_block_get_pos (rtems_rfs_file_system* fs,
- rtems_rfs_block_pos* bpos)
</font><font color='#000088'>+rtems_rfs_block_get_pos (rtems_rfs_file_system* fs,
+ rtems_rfs_block_pos* bpos)
</font> {
<font color='#000088'>+#if 0
</font> rtems_rfs_pos pos = 0;
if (bpos->bno)
{
<font color='#997700'>@@ -66,13 +67,17 @@
</font> pos = rtems_rfs_fs_block_size (fs);
pos += (bpos->bno - 1) * rtems_rfs_fs_block_size (fs);
}
<font color='#000088'>+#else
+ rtems_rfs_pos pos;
+ pos = (bpos->bno * rtems_rfs_fs_block_size (fs)) + bpos->boff;
+#endif
</font> return pos;
}
void
<font color='#880000'>-rtems_rfs_block_get_block_size (rtems_rfs_file_system* fs,
- rtems_rfs_pos pos,
- rtems_rfs_block_size* size)
</font><font color='#000088'>+rtems_rfs_block_get_block_size (rtems_rfs_file_system* fs,
+ rtems_rfs_pos pos,
+ rtems_rfs_block_size* size)
</font> {
if (pos == 0)
rtems_rfs_block_set_size_zero (size);
<font color='#006600'>diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-dir.c:1.6.2.1 rtems/cpukit/libfs/src/rfs/rtems-rfs-dir.c:1.6.2.2
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-dir.c:1.6.2.1 Tue Jun 15 18:35:05 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-dir.c Sun Oct 10 23:40:08 2010
</font><font color='#997700'>@@ -127,6 +127,10 @@
</font> {
uint8_t* entry;
<font color='#000088'>+ if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
+ printf ("rtems-rfs: dir-lookup-ino: block read, ino=%" PRIu32 " bno=%" PRId32 "\n",
+ rtems_rfs_inode_ino (inode), map.bpos.bno);
+<span style="background-color: #FF0000"> </span>
</font> rc = rtems_rfs_buffer_handle_request (fs, &entries, block, true);<span style="background-color: #FF0000"> </span>
if (rc > 0)
{
<font color='#997700'>@@ -171,8 +175,9 @@
</font> {
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO_CHECK))
printf ("rtems-rfs: dir-lookup-ino: "
<font color='#880000'>- "checking entry for ino %" PRId32 ": off=%04" PRIx32 " length:%d ino:%" PRId32 "\n",
- rtems_rfs_inode_ino (inode), map.bpos.boff,
</font><font color='#000088'>+ "checking entry for ino %" PRId32 ": bno=%04" PRIx32 "/off=%04" PRIx32
+ " length:%d ino:%" PRId32 "\n",
+ rtems_rfs_inode_ino (inode), map.bpos.bno, map.bpos.boff,
</font> elength, rtems_rfs_dir_entry_ino (entry));
if (memcmp (entry + RTEMS_RFS_DIR_ENTRY_SIZE, name, length) == 0)
<font color='#997700'>@@ -414,7 +419,7 @@
</font> while (rc == 0)
{
uint8_t* entry;
<font color='#880000'>- int offset;
</font><font color='#000088'>+ int eoffset;
</font>
rc = rtems_rfs_buffer_handle_request (fs, &buffer, block, true);
if (rc > 0)
<font color='#997700'>@@ -425,11 +430,19 @@
</font> rtems_rfs_inode_ino (dir), rc, strerror (rc));
break;
}
<font color='#000088'>+
+ /*
+ * If we are searching start at the beginning of the block. If not searching
+ * skip to the offset in the block.
+ */
+ if (search)
+ eoffset = 0;
+ else
+ eoffset = offset % rtems_rfs_fs_block_size (fs);
</font>
<font color='#880000'>- entry = rtems_rfs_buffer_data (&buffer);
- offset = 0;
</font><font color='#000088'>+ entry = rtems_rfs_buffer_data (&buffer) + eoffset;
</font>
<font color='#880000'>- while (offset < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
</font><font color='#000088'>+ while (eoffset < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
</font> {
rtems_rfs_ino eino;
int elength;
<font color='#997700'>@@ -444,8 +457,9 @@
</font> {
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_DEL_ENTRY))
printf ("rtems-rfs: dir-del-entry: "
<font color='#880000'>- "bad length or ino for ino %" PRIu32 ": %u/%" PRId32 " @ %04x\n",
- rtems_rfs_inode_ino (dir), elength, eino, offset);
</font><font color='#000088'>+ "bad length or ino for ino %" PRIu32 ": %u/%" PRId32
+ " @ %" PRIu32 ".%04x\n",
+ rtems_rfs_inode_ino (dir), elength, eino, block, eoffset);
</font> rc = EIO;
break;
}
<font color='#997700'>@@ -453,7 +467,7 @@
</font> if (ino == rtems_rfs_dir_entry_ino (entry))
{
uint32_t remaining;
<font color='#880000'>- remaining = rtems_rfs_fs_block_size (fs) - (offset + elength);
</font><font color='#000088'>+ remaining = rtems_rfs_fs_block_size (fs) - (eoffset + elength);
</font> memmove (entry, entry + elength, remaining);
memset (entry + remaining, 0xff, elength);
<font color='#997700'>@@ -468,12 +482,13 @@
</font>
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_DEL_ENTRY))
printf ("rtems-rfs: dir-del-entry: "
<font color='#880000'>- "last block free for ino %" PRIu32 ": elength=%i offset=%d last=%s\n",
- ino, elength, offset,
</font><font color='#000088'>+ "last block free for ino %" PRIu32 ": elength=%i block=%" PRIu32
+ " offset=%d last=%s\n",
+ ino, elength, block, eoffset,
</font> rtems_rfs_block_map_last (&map) ? "yes" : "no");
if ((elength == RTEMS_RFS_DIR_ENTRY_EMPTY) &&
<font color='#880000'>- (offset == 0) && rtems_rfs_block_map_last (&map))
</font><font color='#000088'>+ (eoffset == 0) && rtems_rfs_block_map_last (&map))
</font> {
rc = rtems_rfs_block_map_shrink (fs, &map, 1);
if (rc > 0)
<font color='#997700'>@@ -497,8 +512,8 @@
</font> break;
}
<font color='#880000'>- entry += elength;
- offset += elength;
</font><font color='#000088'>+ entry += elength;
+ eoffset += elength;
</font> }
if (rc == 0)
<font color='#006600'>diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-trace.h:1.1 rtems/cpukit/libfs/src/rfs/rtems-rfs-trace.h:1.1.2.1
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-trace.h:1.1 Wed Feb 17 18:24:25 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-trace.h Sun Oct 10 23:40:08 2010
</font><font color='#997700'>@@ -28,7 +28,7 @@
</font> /**
* Is tracing enabled ?
*/
<font color='#880000'>-#define RTEMS_RFS_TRACE 0
</font><font color='#000088'>+#define RTEMS_RFS_TRACE 1
</font>
/**
* The type of the mask.
<font color='#006600'>diff -u rtems/cpukit/libmisc/untar/untar.c:1.12 rtems/cpukit/libmisc/untar/untar.c:1.12.6.1
--- rtems/cpukit/libmisc/untar/untar.c:1.12 Wed Sep 5 18:46:36 2007
+++ rtems/cpukit/libmisc/untar/untar.c Sun Oct 10 23:40:08 2010
</font><font color='#997700'>@@ -39,7 +39,8 @@
</font> * 148 8 bytes Header checksum (in octal ascii)
* 156 1 bytes Link flag
* 157 100 bytes Linkname ('\0' terminated, 99 maxmum length)
<font color='#880000'>- * 257 8 bytes Magic ("ustar \0")
</font><font color='#000088'>+ * 257 8 bytes Magic PAX ("ustar\0" + 2 bytes padding)
+ * 257 8 bytes Magic GNU tar ("ustar \0")
</font> * 265 32 bytes User name ('\0' terminated, 31 maxmum length)
* 297 32 bytes Group name ('\0' terminated, 31 maxmum length)
* 329 8 bytes Major device ID (in octal ascii)
<font color='#997700'>@@ -143,7 +144,7 @@
</font> /* Read the header */
bufr = &tar_ptr[ptr];
ptr += 512;
<font color='#880000'>- if (strncmp(&bufr[257], "ustar ", 7))
</font><font color='#000088'>+ if (strncmp(&bufr[257], "ustar", 5))
</font> {
retval = UNTAR_SUCCESSFUL;
break;
<font color='#997700'>@@ -253,7 +254,7 @@
</font> {
int fd;
char *bufr;
<font color='#880000'>- size_t n;
</font><font color='#000088'>+ ssize_t n;
</font> char fname[100];
char linkname[100];
int sum;
<font color='#997700'>@@ -264,15 +265,17 @@
</font> unsigned long size;
unsigned char linkflag;
<font color='#880000'>-
</font> retval = UNTAR_SUCCESSFUL;
<font color='#000088'>+
+ if ((fd = open(tar_name, O_RDONLY)) < 0) {
+ return UNTAR_FAIL;
+ }
+
</font> bufr = (char *)malloc(512);
<font color='#880000'>- if (bufr == NULL)
- {
</font><font color='#000088'>+ if (bufr == NULL) {
</font> return(UNTAR_FAIL);
}
<font color='#880000'>-
- fd = open(tar_name, O_RDONLY);
</font><font color='#000088'>+<span style="background-color: #FF0000"> </span>
</font> while (1)
{
/* Read the header */
<font color='#997700'>@@ -283,7 +286,7 @@
</font> break;
}
<font color='#880000'>- if (strncmp(&bufr[257], "ustar ", 7))
</font><font color='#000088'>+ if (strncmp(&bufr[257], "ustar", 5))
</font> {
break;
}
</pre>
<p> </p>
<p>--<br />
<small>Generated by <a href="http://www.codewiz.org/projects/index.html#loginfo">Deluxe Loginfo</a> 2.122 by Bernardo Innocenti <bernie@develer.com></small></p>
</body>
</html>