/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to dracut-module/password-agent.c

  • Committer: teddy at recompile
  • Date: 2020-03-02 15:38:40 UTC
  • Revision ID: teddy@recompile.se-20200302153840-k4q8eka6l2re4gwb
Check for fork() returning -1

* dracut-module/password-agent.c (start_mandos_client): Check for
  fork() returning -1.
  (is_privileged): - '' -

Show diffs side-by-side

added added

removed removed

Lines of Context:
868
868
  }
869
869
  close(pipefds[1]);
870
870
 
 
871
  if(pid == -1){
 
872
    error(0, errno, "Failed to fork()");
 
873
    close(pipefds[0]);
 
874
    return false;
 
875
  }
 
876
 
871
877
  if(not add_to_queue(queue, (task_context){
872
878
        .func=wait_for_mandos_client_exit,
873
879
        .pid=pid,
2190
2196
    }
2191
2197
    exit(EXIT_SUCCESS);
2192
2198
  }
 
2199
  if(pid == -1){
 
2200
    error(EXIT_FAILURE, errno, "Failed to fork()");
 
2201
  }
 
2202
 
2193
2203
  int status;
2194
2204
  waitpid(pid, &status, 0);
2195
2205
  if(WIFEXITED(status) and (WEXITSTATUS(status) == EXIT_SUCCESS)){