Пример #1
0
void
coda_1(char *host)
{
	arg = (char *) malloc (100*sizeof(char));
	sprintf(arg, "abc.txt");
	result_1 = update_file_1(&arg, clnt);
	if(result_1 == (int *) NULL) {
		clnt_perror (clnt, "Call failed.\n");
	}
	clnt_destroy (clnt);
}
Пример #2
0
static int
update_file (struct file *file, unsigned int depth)
{
  register int status = 0;
  register struct file *f;

  f = file->double_colon ? file->double_colon : file;

  /* Prune the dependency graph: if we've already been here on _this_
     pass through the dependency graph, we don't have to go any further.
     We won't reap_children until we start the next pass, so no state
     change is possible below here until then.  */
  if (f->considered == considered)
    {
      /* Check for the case where a target has been tried and failed but
         the diagnostics hasn't been issued. If we need the diagnostics
         then we will have to continue. */
      if (!(f->updated && f->update_status > 0 && !f->dontcare && f->no_diag))
        {
          DBF (DB_VERBOSE, _("Pruning file '%s'.\n"));
          return f->command_state == cs_finished ? f->update_status : 0;
        }
    }

  /* This loop runs until we start commands for a double colon rule, or until
     the chain is exhausted. */
  for (; f != 0; f = f->prev)
    {
      f->considered = considered;

      status |= update_file_1 (f, depth);
      check_renamed (f);

      /* Clean up any alloca() used during the update.  */
      alloca (0);

      /* If we got an error, don't bother with double_colon etc.  */
      if (status != 0 && !keep_going_flag)
        return status;

      if (f->command_state == cs_running
          || f->command_state == cs_deps_running)
        {
	  /* Don't run the other :: rules for this
	     file until this rule is finished.  */
          status = 0;
          break;
        }
    }

  /* Process the remaining rules in the double colon chain so they're marked
     considered.  Start their prerequisites, too.  */
  if (file->double_colon)
    for (; f != 0 ; f = f->prev)
      {
        struct dep *d;

        f->considered = considered;

        for (d = f->deps; d != 0; d = d->next)
          status |= update_file (d->file, depth + 1);
      }

  return status;
}