Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/uefisign/uefisign.c
Show First 20 Lines • Show All 404 Lines • ▼ Show 20 Lines | main(int argc, char **argv) | ||||
error = pipe(pipefds); | error = pipe(pipefds); | ||||
if (error != 0) | if (error != 0) | ||||
err(1, "pipe"); | err(1, "pipe"); | ||||
pid = fork(); | pid = fork(); | ||||
if (pid < 0) | if (pid < 0) | ||||
err(1, "fork"); | err(1, "fork"); | ||||
if (pid == 0) | if (pid == 0) { | ||||
close(pipefds[0]); | |||||
exit(child(inpath, outpath, pipefds[1], Vflag, vflag)); | exit(child(inpath, outpath, pipefds[1], Vflag, vflag)); | ||||
} | |||||
close(pipefds[1]); | |||||
if (!Vflag) { | if (!Vflag) { | ||||
certfp = checked_fopen(certpath, "r"); | certfp = checked_fopen(certpath, "r"); | ||||
cert = PEM_read_X509(certfp, NULL, NULL, NULL); | cert = PEM_read_X509(certfp, NULL, NULL, NULL); | ||||
if (cert == NULL) { | if (cert == NULL) { | ||||
ERR_print_errors_fp(stderr); | ERR_print_errors_fp(stderr); | ||||
errx(1, "failed to load certificate from %s", certpath); | errx(1, "failed to load certificate from %s", certpath); | ||||
} | } | ||||
Show All 13 Lines |