Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/bin/sleep



Module Name:    src
Committed By:   kre
Date:           Sat Jan 26 15:20:50 UTC 2019

Modified Files:
        src/bin/sleep: sleep.1 sleep.c

Log Message:
While cute, the previous version is not really safe.
After all, a system might want to sleep for several
thousand years on a spaceship headed to a distant
solar system...

So, remove the pause() code, deal with limits on the
range (it is just an int) that can be passed to sleep()
by looping, and do a much better job of checking for
out of range input values.

With this change sleep(1) should work for durations
up to something more than 250 billion years.  It
fails (at startup, with an error) if the requested
duration is beyond what can be handled.

Here no changes at all related to locales and arg
parsing.    Still for another day.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/bin/sleep/sleep.1
cvs rdiff -u -r1.26 -r1.27 src/bin/sleep/sleep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index