patchGNU MIX Development Kit - Patches: patch #9774, Make tape devices rewind to start...


You are not allowed to post comments on this tracker with your current authentication level.

patch #9774: Make tape devices rewind to start when rewound past start

Submitter:  Kevin Brunelle <brunk23>
Submitted:  Tue 19 Mar 2019 09:54:00 PM UTC
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  jao Open/Closed:  Open

Wed 20 Mar 2019 12:10:15 AM UTC, comment #1: 

Patch applied to master.  Thanks!

Jose Antonio Ortega Ruiz <jao>
Group administrator
Tue 19 Mar 2019 09:54:00 PM UTC, original submission:  

According to the specification, if M < 0, the tape is skipped backwards M blocks, or to the beginning of the tape, whichever comes first.  In the implementation, we don't check to verify that we aren't seeking past the beginning of the file. This causes fseek(3) to fail, and it leaves us at the position we were at.

I have attached a demo of this as mixal source, and a simple patch that causes the tape to rewind correctly.

Summary of changes:
-      if (m == 0) rewind (file);
+      if (m == 0 || (ftell (file) + m <= 0 )) rewind (file);

-Kevin Brunelle

Kevin Brunelle <brunk23>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #46586:  tape-ioc-error-demo.mixal added by brunk23 (416B - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by jao (Posted a comment)
  • -email is unavailable- added by brunk23 (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.


    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-03-20 jao StatusNone Done
        Assigned toNone jao
    2019-03-19 brunk23 Attached File- Added tape-ioc-error-demo.mixal, #46586
        Attached File- Added tape-ioc-error-patch.txt, #46587

    Back to the top

    Powered by Savane 3.13-b921.
    Corresponding source code