int idle = TRUE;
int idle;
job_runqueue (void){  job *j, *jn;  int idle = TRUE;  int run = 0;  idle = (getloadavg () <= MAXLOADAVG	  && get_diskload (diskavg_file, diskavg_matrix) <= MAX_DISKLOAD);  for (j = jhead; j; j = jn)    {      jn = j->next;      /* run command if we are idle       * or       * if the RUN_ONLY_IDLE flag is not set       */      if (idle || (!(j->e->flags & RUN_ONLY_IDLE)))	{	  do_command (j->e, j->u);	  /* if we want to run idle only once (probably a catch up job)	   * delete RUN_ONLY_IDLE flag	   */	  if (RUN_IDLE_ONCE & j->e->flags)	    {	      j->e->flags &= ~RUN_ONLY_IDLE;	    };	  if (jn)	    {	      jn->prev = j->prev;	    }	  else	    {	      jtail = j->prev;	    }	  if (j->prev)	    {	      j->prev->next = jn;	    }	  else	    {	      jhead = jn;	    }	  free (j);	  run++;	};    }  return run;}