# HG changeset patch # User Binki # Date 2009-09-13 16:46:20 # Node ID 5b5bb72840e697212531e2c38b62582620c6f95e # Parent 633e938f261d476f103de08a80ecb907320e00d1 fix up main() for dummy linkedlist head diff --git a/src/server/distrend.c b/src/server/distrend.c --- a/src/server/distrend.c +++ b/src/server/distrend.c @@ -577,15 +577,13 @@ int main(int argc, char *argv[]) /* @TODO: Put some arg-grabbing code here */ - struct distrenjob *head; - head->priority = 0; // make head have the highest priority + struct distrenjob head; + head.priority = 0; // make head have the highest priority int cont; struct distrend_listenset *listenset; struct distrend_config *config; - start_data(); // Starts fresh or loads data from xml dump. Should we grab the return? - enum clientstatus { CLIENTSTATUS_UNINITIALIZED = 0, @@ -593,8 +591,10 @@ int main(int argc, char *argv[]) CLIENTSTATUS_IDLE = 2 } clientstatus; - head = NULL; cont = 1; + memset(&head, '\0', sizeof(struct distrenjob)); + + start_data(); // Starts fresh or loads data from xml dump. Should we grab the return? distrend_do_config(argc, argv, &config); @@ -610,7 +610,7 @@ int main(int argc, char *argv[]) /* Make the following code more event-driven */ status_report_generator(&head); - blend_frame_watchdog(head); + blend_frame_watchdog(&head); struct frameset *frame; @@ -619,7 +619,7 @@ int main(int argc, char *argv[]) /* If the client is idle, must be modified for climbing through linked list of clients (client->clientnum) */ if(clientstatus == CLIENTSTATUS_IDLE) { - int returnnum = frame_finder(head, &job, &frame); // Finds a frame to render + int returnnum = frame_finder(&head, &job, &frame); // Finds a frame to render if(returnnum) { fprintf(stderr,"No frames are available to render at this time. Idling...\n"); @@ -633,7 +633,7 @@ int main(int argc, char *argv[]) /* If the client states that they finished the frame */ if(clientsays == DISTREN_REQUEST_DONEFRAME){ clientstatus = CLIENTSTATUS_IDLE; // Sets the client back to idle - finish_frame(head, frame->num); // @TODO: Check that finish_frame really gets the jobnum somehow + finish_frame(&head, frame->num); // @TODO: Check that finish_frame really gets the jobnum somehow } distrend_action_free(action);