Salome HOME
Update copyrights
[tools/libbatch.git] / src / PBS / Batch_Job_PBS.cxx
index f55f05aefea8376de94f5be413258c89eaf8018d..318626249108ef92a9f8a721917a3f43296351d5 100644 (file)
@@ -1,4 +1,4 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//  Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -32,6 +32,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
+#include <cstring>
+
+#include "Batch_Constants.hxx"
 #include "Batch_Job_PBS.hxx"
 using namespace std;
 
@@ -170,11 +173,10 @@ namespace Batch {
 
       } else if ( (*it).first == MAXWALLTIME ) {
        char attr_value[32];
-       long secondes = (*it).second;
-       long heures = secondes / 3600L;
-       long minutes = (secondes - 3600L * heures) / 60L;
-       secondes = secondes % 60L;
-       sprintf(attr_value, "%02ld:%02ld:%02ld", heures, minutes, secondes);
+       long minutes = (*it).second;
+       long heures = minutes / 60L;
+       minutes -= 60L * heures;
+       sprintf(attr_value, "%02ld:%02ld:00", heures, minutes);
 
        setResourceAttributeOP(_p_attr_list, ATTR_l, "walltime", attr_value);