~ubuntu-branches/ubuntu/raring/uml-utilities/raring

« back to all changes in this revision

Viewing changes to uml_net/host.c

  • Committer: Bazaar Package Importer
  • Author(s): Matt Zimmerman
  • Date: 2004-04-14 17:59:45 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040414175945-olq69xkt2da1oxca
Tags: 20040406-1
* New upstream release
* Patch from Carlos Perelló Marín to fix uml_proxy_arp with multiple
  addresses (Closes: #243834)

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
    exit(1);
42
42
  }
43
43
  else if(pid < 0){
44
 
    perror("fork failed");
 
44
    output_errno(output, "fork failed");
45
45
    return(-1);
46
46
  }
47
47
  if(output){
48
48
    close(fds[1]);
49
49
    while((n = read(fds[0], buf, sizeof(buf))) > 0) add_output(output, buf, n);
50
 
    if(n < 0) perror("Reading command output");
 
50
    if(n < 0) output_errno(output, "Reading command output");
51
51
  }
52
52
  if(waitpid(pid, &status, 0) < 0){
53
 
    perror("execvp");
 
53
    output_errno(output, "waitpid");
54
54
    return(-1);
55
55
  }
56
56
  if(need_zero && (!WIFEXITED(status) || (WEXITSTATUS(status) != 0))){
57
 
    printf("'%s' didn't exit with status 0\n", args[0]);
 
57
    sprintf(buf, "'%s' didn't exit with status 0\n", args[0]);
 
58
    add_output(output, buf, -1);
58
59
    return(-1);
59
60
  }
60
61
  return(0);
243
244
                 struct output *output)
244
245
{
245
246
  if(setreuid(0, 0) < 0){
246
 
    perror("setreuid");
 
247
    output_errno(output, "setreuid");
247
248
    exit(1);
248
249
  }
249
250
  if(!strcmp(op, "add")) route_and_arp(dev, address, netmask, 0, output);