[Bug 1893] New: [IMFS] truncate doesn't empty file

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Sun Aug 7 15:33:01 UTC 2011


https://www.rtems.org/bugzilla/show_bug.cgi?id=1893

           Summary: [IMFS] truncate doesn't empty file
           Product: RTEMS
           Version: HEAD
          Platform: All
        OS/Version: RTEMS
            Status: NEW
          Severity: normal
          Priority: P3
         Component: filesystem
        AssignedTo: chrisj at rtems.org
        ReportedBy: medivhc at gmail.com


IMFS fails in fsrdwr test in fstests.

254   /*
255    * Truncate it to the half size, and then truncate it to len.
256    */
257   status = truncate (name01, len / 2);
258   rtems_test_assert (status == 0);
259   status = truncate (name01, len);
260   rtems_test_assert (status == 0);
261
262   /*
263    * verify the data
264    */
265   readbuf = (char *) malloc (len / 2);
266   rtems_test_assert (readbuf);
267   fd = open (name01, O_RDONLY);
268
269   rtems_test_assert (fd != -1);
270   n = read (fd, readbuf, len / 2);
271   rtems_test_assert (n == len / 2);
272   rtems_test_assert (!strncmp (databuf, readbuf, len / 2));
273
274   /*
275    * The data from len / 2 to the end should be zero
276    */
277   n = read (fd, readbuf, len / 2);
278   rtems_test_assert (n == len / 2);
279   for (i = 0; i < len / 2; i++) {
280     rtems_test_assert (readbuf[i] == 0);
281   }

   status = truncate (name01, len / 2);
   status = truncate (name01, len);

the data should be set zero from len/2 to len.

-- 
Configure bugmail: https://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the bugs mailing list