Changeset - 50ff9ed2fc39
[Not reviewed]
default
0 1 0
LordOfWar - 16 years ago 2009-09-18 00:08:24

consulting ohnobinki and normaldotcom I have changed mortition to use _distren_asprintf, in order to use that I have also added asprintf.c to the includes.
1 file changed with 3 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/server/distrend.c
Show inline comments
 
@@ -22,12 +22,13 @@
 

	
 
#include "execio.h"
 
#include "options.h"
 
#include "distrenjob.h"
 
#include "protocol.h"
 
#include "slavefuncs.h"
 
#include "asprintf.c"
 

	
 
#include <confuse.h>
 
#include <stdio.h>
 
#include <stdlib.h>
 
#include <malloc.h>
 
#include <unistd.h> /* getopt */
 
@@ -157,19 +158,19 @@ void finish_frame(struct distrenjob *hea
 

	
 
/** mortition check to see if a job is actually done by scanning the folder of the job to make sure all frames are present*/
 
// called mortition because it checks the finished "dead" job
 
void mortition(struct distrenjob *head, struct distrenjob *job){
 
  short int isJobDone;
 
  int counter;
 
  char path_and_number[20];
 
  char *path_and_number;
 
  struct stat buffer;
 

	
 
  isJobDone = 1; // set isJobDone to true
 
  for(counter = 0; counter < job->total_frames; counter++)
 
    {
 
      sprintf(path_and_number, "stor/job%d/out/%d.%s", job->jobnum, (counter + job->frameset[0].num), job->output_format);
 
      _distren_asprintf(&path_and_number, "stor/job%d/out/%d.%s", job->jobnum, job->frameset[counter].num, job->output_format);
 
      if(stat(path_and_number, &buffer) != -1)
 
        {
 
          job->frameset[counter].status = FRAMESETSTATUS_UNASSIGNED;
 
          job->completed_frames--;
 
          isJobDone = 0; // if a missing frame is found, set isJobDone to false
 
        }
0 comments (0 inline, 0 general)