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

Submitted by:  Kevin Brunelle <brunk23>
Submitted on:  Tue 19 Mar 2019 09:54:00 PM UTC  
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  Jose Antonio Ortega Ruiz <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>
Project AdministratorIn charge of this item.
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>


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)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




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