Changeset - b236a45982d4
[Not reviewed]
default
0 3 0
Nathan Brink (binki) - 16 years ago 2009-09-13 16:20:45
ohnobinki@ohnopublishing.net
fixed delete_jobdata() slightly
3 files changed with 9 insertions and 7 deletions:
0 comments (0 inline, 0 general)
src/server/slave.c
Show inline comments
 
@@ -126,27 +126,28 @@ char *pathtoTar;     // Full path to the
 
char *urltoOutput;   // Full URL where output is posted
 
char *pathtoJobfile; // Full path to the job's main file
 
char *pathtoXml;     // Full path to the job's xml file
 
char *pathtoOutput;  // Full path to the output (rendered) file
 
char *outputExt;     // Output Extension (e.g., JPG)
 

	
 
int threads = sysconf(_SC_NPROCESSORS_ONLN); // Equals the number of currently online processors
 
// FOR Win32: int threads = sysinfo.dwNumberOfProcessors;
 

	
 
struct distrenjob *myjob; // Structure to hold data gathered from the XML file
 

	
 
/* If the server says that every frame for jobnum is finished */
 
if( 1 == 0){
 
delete_jobdata(jobnum);
 
}
 
if( 1 == 0)
 
  {
 
    delete_jobdata(jobnum, datadir);
 
  }
 

	
 
// If the slave is getting job info...
 
if(gotframe ==1)
 
  {
 
    /* @TODO: fix these remoteio_read's */
 
    jobnum = remoteio_read(jobnum); // Set jobnum from remoteio (we could use info from struct, but we need this info to download the xmlfile)
 
    framenum = remoteio_read(jobnum); // Set framenum from remoteio
 

	
 
    char *tarcmd;
 
    char *outdir;
 
    char *jobdatapath;
 

	
src/server/slavefuncs.c
Show inline comments
 
@@ -55,29 +55,30 @@ xmlNodePtr xml_quickxpath(xmlXPathContex
 
      return (xmlNodePtr)NULL;
 
    }
 

	
 
  toreturn = *(xmlxpathobjptr->nodesetval->nodeTab);
 

	
 
  xmlXPathFreeObject(xmlxpathobjptr);
 

	
 
  return toreturn;
 
}
 

	
 

	
 
/** Stub for deleting job data from the disk. @TODO: unstubify me! */
 
int delete_jobdata(int jobnum, char datadir){
 
int delete_jobdata(int jobnum, char *datadir)
 
{
 
  char *jobpath;
 
  _distren_asprintf(&jobpath, "%s/%d",datadir,jobnum);
 
  _distren_asprintf(&jobpath, "%s/%d", datadir, jobnum);
 
  rmdir(jobpath);
 
  fprintf(stderr,"I just failed to remove all of your job data because I can only delete empty directories! Haha!\nPlease contact the dev team :D\n");
 
  fprintf(stderr, "I just failed to remove all of your job data because I can only delete empty directories! Haha!\nPlease contact the dev team :D\n\tWe'd be overjoyed to know that someone was willing to try to use this in this devel/design/planning stage ;-)\n");
 
  return 0;
 
}
 

	
 
/** Stub stub stubbiness ugh @TODO: Kill me. */
 
void tell_the_server(char *stuff){
 
}
 

	
 
/** Function referenced by curlget() to write data to disk. */
 
size_t curl_writetodisk(void *ptr, size_t size, size_t nmemb, FILE *stream)
 
 {
 
    return fwrite(ptr, size, nmemb, stream);
 
  }
src/server/slavefuncs.h
Show inline comments
 
@@ -18,25 +18,25 @@
 
*/
 

	
 
#ifndef _DISTREN_SLAVEFUNCS_H
 
#define _DISTREN_SLAVEFUNCS_H
 

	
 
#include "distrenjob.h"
 

	
 
#include <libxml/xpath.h>
 
#include <stdio.h>
 

	
 
xmlNodePtr xml_quickxpath(xmlXPathContextPtr xpathctxt, xmlChar *path);
 
void tell_the_server(char *stuff);
 
int delete_jobdata(int jobnum, char datadir);
 
int delete_jobdata(int jobnum, char *datadir);
 
size_t curl_writetodisk(void *ptr, size_t size, size_t nmemb, FILE *stream);
 
int curlget(char *url, char *out);
 
int curlpost(char *filename, char *url);
 
int ssh_keygen();
 
int register_user(char *username, char *email);
 
int login_user(char *username);
 
int conf_replace(char *username);
 
void exec_blender(struct distrenjob* distrenjob, char *input, char *output, int frame, int threads);
 
void xmlinit();
 
void xmlcleanup();
 

	
 
#endif
0 comments (0 inline, 0 general)