torture_comment(tctx, "New file time is %s", ctime(&t));
- if (abs(t - time(NULL)) > 60*60*24*10) {
+ if (labs(t - time(NULL)) > 60*60*24*10) {
torture_result(tctx, TORTURE_FAIL, "ERROR: SMBgetatr bug. time is %s",
ctime(&t));
t = time(NULL);
torture_comment(tctx, "modify time=%s", ctime(&m_time));
torture_comment(tctx, "This system appears to have sticky create times\n");
}
- if ((abs(a_time - t) > 60) && (a_time % (60*60) == 0)) {
+ if ((labs(a_time - t) > 60) && (a_time % (60*60) == 0)) {
torture_comment(tctx, "access time=%s", ctime(&a_time));
torture_result(tctx, TORTURE_FAIL, "This system appears to set a midnight access time\n");
correct = false;
}
- if (abs(m_time - t) > 60*60*24*7) {
+ if (labs(m_time - t) > 60*60*24*7) {
torture_result(tctx, TORTURE_FAIL, "ERROR: totally incorrect times - maybe word reversed? mtime=%s", ctime(&m_time));
correct = false;
}
CHECK_STATUS(status, NT_STATUS_OK); \
t1 = t & ~1; \
t2 = nt_time_to_unix(finfo.all_info.out.field) & ~1; \
- if (abs(t1-t2) > 2) { \
+ if (labs(t1-t2) > 2) { \
torture_result(tctx, TORTURE_FAIL, \
"(%s) wrong time for field %s %s - %s\n", \
__location__, #field, \
static int dos_nt_time_cmp(time_t t, NTTIME nt)
{
time_t t2 = nt_time_to_unix(nt);
- if (abs(t2 - t) <= 2) return 0;
+ if (labs(t2 - t) <= 2) return 0;
return t2 > t ? 1 : -1;
}
*/
#include "includes.h"
+#include <math.h>
#include "libcli/libcli.h"
#include "torture/util.h"
#include "torture/basic/proto.h"
s2->allocation.out.sectors_per_unit *
s2->allocation.out.total_alloc_units *
s2->allocation.out.bytes_per_sector / scale;
- if (abs(size1 - size2) > 1) {
+ if (fabs(size1 - size2) > 1) {
printf("Inconsistent total size in DSKATTR and ALLOCATION - size1=%.0f size2=%.0f\n",
size1, size2);
ret = false;
s2->allocation.out.sectors_per_unit *
s2->allocation.out.avail_alloc_units *
s2->allocation.out.bytes_per_sector / scale;
- if (abs(size1 - size2) > 1) {
+ if (fabs(size1 - size2) > 1) {
printf("Inconsistent avail size in DSKATTR and ALLOCATION - size1=%.0f size2=%.0f\n",
size1, size2);
ret = false;