[Bug 1871] New: [rfs] opening file with O_WRONL|O_APPEND doesn't work as expect

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Mon Aug 1 13:47:13 UTC 2011


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

           Summary: [rfs] opening file with O_WRONL|O_APPEND  doesn't work
                    as expect
           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


fd = open (name01, O_CREAT | O_WRONLY, mode);
  status = close (fd);
  rtems_test_assert (status == 0);

  /*
   * Write data to the empty file
   */
  fd = open (name01, O_WRONLY);
  rtems_test_assert (fd != -1);

  n = write (fd, databuf, len);
  rtems_test_assert (n == len);
  status = close (fd);
  rtems_test_assert (status == 0);

  /*
   *Open the file using O_APPEND and write the data
   */
  memset (readbuf, 0, len + 1);
  fd = open (name01, O_WRONLY | O_APPEND);
  n = write (fd, databuf, len);
  rtems_test_assert (n == len);
  pos = lseek (fd, 0, SEEK_CUR);
  rtems_test_assert (pos == 2 * len); /* THE TEST FAILS HERE */

-- 
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