Commit c5844ce7 authored by Niels Möller's avatar Niels Möller
Browse files

(main_argp_parser): Updated for changes to

io_write_file.

Rev: src/srp-gen.c:1.24
parent 82244895
...@@ -142,26 +142,21 @@ main_argp_parser(int key, char *arg, struct argp_state *state) ...@@ -142,26 +142,21 @@ main_argp_parser(int key, char *arg, struct argp_state *state)
argp_error(state, "No user name given. Use the -l option, or set LOGNAME in the environment."); argp_error(state, "No user name given. Use the -l option, or set LOGNAME in the environment.");
{ {
struct lsh_fd *fd;
if (self->file) if (self->file)
{ {
const char *cfile = lsh_get_cstring(self->file); const char *cfile = lsh_get_cstring(self->file);
fd = io_write_file(cfile,
O_CREAT | O_EXCL | O_WRONLY, self->dest = io_write_file(cfile,
0600, BLOCK_SIZE, O_CREAT | O_EXCL | O_WRONLY,
NULL, self->e); 0600, self->e);
if (!fd) if (!self->dest)
argp_failure(state, EXIT_FAILURE, errno, argp_failure(state, EXIT_FAILURE, errno,
"Could not open '%s'.", cfile); "Could not open '%s'.", cfile);
} }
else else
{ {
fd = io_write(make_lsh_fd(STDOUT_FILENO, IO_STDIO, "stdout", self->dest = make_io_write_file(STDOUT_FILENO, self->e);
self->e),
BLOCK_SIZE, NULL);
} }
self->dest = &fd->write_buffer->super;
} }
while (!self->passwd) while (!self->passwd)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment