home
/
code
/
khatus.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rename lib files to and prefix lib function names
[khatus.git]
/
x5
/
khlib_time.c
diff --git
a/x5/khatus_lib_time.c
b/x5/khlib_time.c
similarity index 72%
rename from
x5/khatus_lib_time.c
rename to
x5/khlib_time.c
index
d13f689
..
c55e0af
100644
(file)
--- a/
x5/khatus_lib_time.c
+++ b/
x5/khlib_time.c
@@
-5,11
+5,11
@@
#include <string.h>
#include <time.h>
#include <string.h>
#include <time.h>
-#include "kh
atus_
lib_log.h"
-#include "kh
atus_
lib_time.h"
+#include "khlib_log.h"
+#include "khlib_time.h"
struct timespec
struct timespec
-timespec_of_float(double n)
+
khlib_
timespec_of_float(double n)
{
double integral;
double fractional;
{
double integral;
double fractional;
@@
-23,16
+23,13
@@
timespec_of_float(double n)
}
void
}
void
-
snooze
(struct timespec *t)
+
khlib_sleep
(struct timespec *t)
{
struct timespec remainder;
{
struct timespec remainder;
- int result;
- result = nanosleep(t, &remainder);
-
- if (result < 0) {
+ if (nanosleep(t, &remainder) < 0) {
if (errno == EINTR) {
if (errno == EINTR) {
- warn(
+
khlib_
warn(
"nanosleep interrupted. Remainder: "
"{ tv_sec = %ld, tv_nsec = %ld }",
remainder.tv_sec, remainder.tv_nsec);
"nanosleep interrupted. Remainder: "
"{ tv_sec = %ld, tv_nsec = %ld }",
remainder.tv_sec, remainder.tv_nsec);
@@
-40,7
+37,7
@@
snooze(struct timespec *t)
* so not attempting to correct after an interruption.
*/
} else {
* so not attempting to correct after an interruption.
*/
} else {
- fatal("nanosleep: %s\n", strerror(errno));
+
khlib_
fatal("nanosleep: %s\n", strerror(errno));
}
}
}
}
}
}
This page took
0.030068 seconds
and
4
git commands to generate.