removed code without effect
time_t represents the number of seconds since the birth of unix.
to deal with microseconds and friends, use
a) gettimeofday
b) struct timeval
--- a/Makefile
+++ b/Makefile
@@ -359,7 +359,7 @@
sts: sts.o
@echo Linking $<...
- @$(CC) -Wall -O2 -lm -g -ggdb $(LDFLAGS) $< -o $@
+ @$(CC) -Wall -O2 -g -ggdb $(LDFLAGS) $< -o $@
.PHONY: beauty clean uninstall
--- a/sts.c
+++ b/sts.c
@@ -6,7 +6,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <math.h>
#include <time.h>
#include <errno.h>
@@ -20,15 +19,13 @@
{
time_t sec = 0;
time_t milli = 0;
- double value;
if (sscanf (buf, "%ld.%ld", &sec, &milli) != 2) {
fprintf (stderr, " sec: %ld, ", sec);
fprintf (stderr, "milli: %ld\n", milli);
}
- value = (milli / 1000000);
- return sec + (time_t) (floor (value));
+ return sec;
}
time_t getboottime ()