Menu

#1135 STAFEventSem incorrectly sets timespec nanosec field

Unix
closed-fixed
None
5
2008-06-25
2008-06-24
No

in stafif/unix/STAFEventSem.cpp in STAFEventSemWait(), the nanosecond field of theTimeout is being set incorrectly. Instead of multiplying (timeout % 1000) by 1000, it should be multiplied by 1000000 since we're talking about converting milliseconds to nanoseconds.

Discussion

  • Sharon Lucas

    Sharon Lucas - 2008-06-24
    • assigned_to: nobody --> slucas
     
  • Sharon Lucas

    Sharon Lucas - 2008-06-25

    Logged In: YES
    user_id=285070
    Originator: NO

    Index: stafif/unix/STAFEventSem.cpp

    RCS file: /cvsroot/staf/src/staf/stafif/unix/STAFEventSem.cpp,v
    retrieving revision 1.10
    diff -r1.10 STAFEventSem.cpp
    297a298,301
    >
    > // Convert timeout (in milliseconds) to the timespec structure
    > // which consists of seconds and nanoseconds
    >
    299c303
    < (timeout % 1000) * 1000 };
    ---
    > (timeout % 1000) * 1000000 };

     
  • Sharon Lucas

    Sharon Lucas - 2008-06-25
    • status: open --> closed-fixed
     
  • Sharon Lucas

    Sharon Lucas - 2008-06-26

    Logged In: YES
    user_id=285070
    Originator: NO

    Made same fix in stafif/unix/STAFMutexSem.cpp.

    Index: stafif/unix/STAFMutexSem.cpp

    RCS file: /cvsroot/staf/src/staf/stafif/unix/STAFMutexSem.cpp,v
    retrieving revision 1.7
    diff -r1.7 STAFMutexSem.cpp
    87a88,90
    > // Convert timeout (in milliseconds) to the timespec structure
    > // which consists of seconds and nanoseconds
    >
    89c92
    < (timeout % 1000) * 1000 };
    ---
    > (timeout % 1000) * 1000000 };

     

Log in to post a comment.