Commit 0074aa6e authored by Niels Möller's avatar Niels Möller

(werror_vformat): Don't output any punctuation for

%e. Changed all callers to use it like "...: %e.\n".

Rev: src/adns.c:1.5
Rev: src/channel_forward.c:1.21
Rev: src/client.c:1.179
Rev: src/client_tcpforward.c:1.11
Rev: src/client_x11.c:1.39
Rev: src/daemon.c:1.22
Rev: src/gateway.c:1.25
Rev: src/io.c:1.231
Rev: src/lsh-decode-key.c:1.26
Rev: src/lsh-decrypt-key.c:1.7
Rev: src/lsh-export-key.c:1.24
Rev: src/lsh-keygen.c:1.25
Rev: src/lsh-make-seed.c:1.27
Rev: src/lsh-transport.c:1.20
Rev: src/lsh.c:1.223
Rev: src/lshd-connection.c:1.14
Rev: src/lshd-userauth.c:1.14
Rev: src/lshd.c:1.186
Rev: src/reaper.c:1.29
Rev: src/seed_file.c:1.4
Rev: src/server_pty.c:1.35
Rev: src/server_session.c:1.118
Rev: src/server_x11.c:1.30
Rev: src/socks.c:1.11
Rev: src/srp-gen.c:1.28
Rev: src/transport.c:1.16
Rev: src/unix_interact.c:1.33
Rev: src/unix_process.c:1.23
Rev: src/unix_random.c:1.24
Rev: src/unix_random_user.c:1.3
Rev: src/werror.c:1.82
parent 0335e44f
......@@ -103,7 +103,7 @@ make_resolver(void)
if ( (res = adns_init(&self->adns, flags, NULL)) )
{
werror("adns_init failed %e\n", res);
werror("adns_init failed: %e.\n", res);
KILL(self);
return NULL;
}
......
......@@ -61,7 +61,7 @@ void
channel_forward_shutdown(struct channel_forward *self)
{
if (shutdown (self->write.fd, SHUT_WR) < 0)
werror("close_fd_write, shutdown failed, %e\n", errno);
werror("close_fd_write, shutdown failed: %e.\n", errno);
assert(self->super.sinks);
self->super.sinks--;
......
......@@ -138,7 +138,7 @@ oop_write_service(oop_source *source UNUSED, int fd, oop_event event, void *stat
}
else if (errno != EWOULDBLOCK)
{
werror("oop_write_service: Write failed: %e\n", errno);
werror("oop_write_service: Write failed: %e.\n", errno);
exit(EXIT_FAILURE);
}
return OOP_CONTINUE;
......@@ -204,7 +204,7 @@ write_packet(struct client_connection *connection,
}
else
{
werror("write_packet: Write failed: %e\n", errno);
werror("write_packet: Write failed: %e.\n", errno);
exit(EXIT_FAILURE);
}
}
......@@ -253,7 +253,7 @@ oop_read_service(oop_source *source UNUSED, int fd, oop_event event, void *state
switch (status)
{
case SSH_READ_IO_ERROR:
werror("Read failed: %e\n", errno);
werror("Read failed: %e.\n", errno);
exit(EXIT_FAILURE);
break;
case SSH_READ_PROTOCOL_ERROR:
......@@ -604,7 +604,7 @@ DEFINE_ESCAPE(exit_callback, "Exit.")
DEFINE_ESCAPE(suspend_callback, "Suspend.")
{
if (kill(getpid(), SIGTSTP) < 0)
werror("do_suspend: kill failed %e\n", errno);
werror("do_suspend: kill failed: %e.\n", errno);
}
DEFINE_ESCAPE(quiet_callback, "Toggle warning messages.")
......
......@@ -69,7 +69,7 @@ do_forward_local_port(struct client_connection_action *s,
}
else if (!io_listen(port))
{
werror("Listening on local port %S:%i failed: %e\n",
werror("Listening on local port %S:%i failed: %e.\n",
self->local->ip, self->local->port, errno);
KILL_RESOURCE(&port->super.super);
}
......
......@@ -389,7 +389,7 @@ x11_connect(struct client_x11_display *display,
if (!io_connect(&self->super, display->address_length, display->address))
{
werror("Connecting to X11 server failed %e\n", errno);
werror("Connecting to X11 server failed: %e.\n", errno);
return NULL;
}
return &self->super.super.super;
......
......@@ -74,7 +74,7 @@ daemon_pidfile(const char *name)
{
if (errno != EEXIST)
{
werror("Failed to open pid file '%z' %e\n",
werror("Failed to open pid file '%z': %e.\n",
name, errno);
return 0;
}
......@@ -96,11 +96,11 @@ daemon_pidfile(const char *name)
lsh_string_free(pid);
return 1;
}
werror("Writing pid file '%z' failed %e\n", name, errno);
werror("Writing pid file '%z' failed: %e.\n", name, errno);
/* Attempt unlinking file */
if (unlink(name) < 0)
werror("Unlinking pid file '%z' failed %e\n",
werror("Unlinking pid file '%z' failed: %e.\n",
name, errno);
lsh_string_free(pid);
......@@ -171,12 +171,12 @@ daemon_dup_null(int fd)
int null = open("/dev/null", O_RDWR);
if (null < 0)
{
werror("Opening /dev/null failed: %e\n", errno);
werror("Opening /dev/null failed: %e.\n", errno);
return 0;
}
if (dup2(null, fd) < 0)
{
werror("Failed to redirect fd %i to /dev/null: %e\n", errno);
werror("Failed to redirect fd %i to /dev/null: %e.\n", errno);
close(null);
return 0;
}
......@@ -221,7 +221,7 @@ daemon_close_fds(void)
if (res == 0)
werror("Closed spurious fd %i\n", fd);
else if (errno != EBADF)
werror("Closing spurious fd %i failed: %e\n", fd, errno);
werror("Closing spurious fd %i failed: %e.\n", fd, errno);
}
}
......@@ -310,7 +310,7 @@ daemon_close(const char *name)
{
if (unlink(name) < 0)
{
werror("daemon_close: Unlink of pid file '%z' failed %e\n",
werror("daemon_close: Unlink of pid file '%z' failed: %e.\n",
name, errno);
return 0;
}
......
......@@ -189,7 +189,7 @@ oop_write_gateway(oop_source *source UNUSED, int fd, oop_event event, void *stat
}
else if (errno != EWOULDBLOCK)
{
werror("oop_write_gateway: Write failed: %e\n", errno);
werror("oop_write_gateway: Write failed: %e.\n", errno);
KILL_RESOURCE(&self->super.super);
}
return OOP_CONTINUE;
......@@ -258,7 +258,7 @@ gateway_write_packet(struct gateway_connection *connection,
if (error)
{
werror("gateway_write_packet: Write failed: %e\n", errno);
werror("gateway_write_packet: Write failed: %e.\n", errno);
KILL_RESOURCE(&connection->super.super);
}
}
......@@ -324,7 +324,7 @@ oop_read_gateway(oop_source *source UNUSED, int fd, oop_event event, void *state
switch (status)
{
case SSH_READ_IO_ERROR:
werror("Read from gateway failed: %e\n", errno);
werror("Read from gateway failed: %e.\n", errno);
KILL_RESOURCE(&self->super.super);
break;
case SSH_READ_PROTOCOL_ERROR:
......@@ -450,7 +450,7 @@ do_gateway_port_accept(struct io_listen_port *s,
int error = gateway_write_data (gateway, sizeof(hello), hello);
if (error)
{
werror ("Sending gateway hello message failed: %e\n", error);
werror ("Sending gateway hello message failed: %e.\n", error);
KILL_RESOURCE (&gateway->super.super);
return;
}
......@@ -472,7 +472,7 @@ make_gateway_port(const struct local_info *local,
fd = io_bind_local(local);
if (fd < 0)
{
werror("Binding local gateway socket failed: %e\n", errno);
werror("Binding local gateway socket failed: %e.\n", errno);
return NULL;
}
else
......
......@@ -271,7 +271,7 @@ io_run(void)
/* We need liboop-0.8, OOP_ERROR is not defined in liboop-0.7. */
if (res == OOP_ERROR)
werror("oop_sys_run %e\n", errno);
werror("oop_sys_run: %e.\n", errno);
trace("io_run: Cleaning up\n");
......@@ -498,7 +498,7 @@ oop_io_accept(oop_source *source UNUSED,
s = accept(fd, (struct sockaddr *) &peer, &peer_length);
if (s < 0)
werror("accept failed, fd = %i: %e\n", fd, errno);
werror("accept failed, fd = %i: %e.\n", fd, errno);
else
self->accept(self, s, peer_length, (struct sockaddr *) &peer);
......@@ -589,7 +589,7 @@ io_readable_p(int fd)
int nbytes = 0;
if (ioctl(fd, FIONREAD, &nbytes) < 0)
{
debug("ioctl FIONREAD failed: %e\n", errno);
debug("ioctl FIONREAD failed: %e.\n", errno);
return 0;
}
return nbytes != 0;
......@@ -867,9 +867,9 @@ handle_nonblock_error(const char *msg)
* and where it occurs.
*/
if (errno == ENODEV || errno == ENOTTY)
werror("%z %e\n", msg, errno);
werror("%z: %e.\n", msg, errno);
else
fatal("%z %e\n", msg, errno);
fatal("%z: %e.\n", msg, errno);
}
void
......@@ -878,7 +878,7 @@ io_set_nonblocking(int fd)
int old = fcntl(fd, F_GETFL);
if (old < 0)
fatal("io_set_nonblocking: fcntl(F_GETFL) failed: %e\n", errno);
fatal("io_set_nonblocking: fcntl(F_GETFL) failed: %e.\n", errno);
if (fcntl(fd, F_SETFL, old | O_NONBLOCK) < 0)
handle_nonblock_error("io_set_nonblocking: fcntl(F_SETFL) failed");
......@@ -893,10 +893,10 @@ io_set_close_on_exec(int fd)
int old = fcntl(fd, F_GETFD);
if (old < 0)
fatal("io_set_close_on_exec: fcntl(F_GETFD) failed %e\n", errno);
fatal("io_set_close_on_exec: fcntl(F_GETFD) failed: %e.\n", errno);
if (fcntl(fd, F_SETFD, old | 1) < 0)
fatal("Can't set close-on-exec flag for fd %i %e\n", fd, errno);
fatal("Can't set close-on-exec flag for fd %i: %e.\n", fd, errno);
}
......@@ -926,7 +926,7 @@ lsh_popd(int old_cd, const char *directory)
{
while (fchdir(old_cd) < 0)
if (errno != EINTR)
fatal("io.c: Failed to cd back from %z %e\n",
fatal("io.c: Failed to cd back from %z: %e.\n",
directory, errno);
close(old_cd);
......@@ -952,7 +952,7 @@ lsh_pushd_fd(int dir)
while (fchdir(old_cd) < 0)
if (errno != EINTR)
{
werror("io.c: fchdir(`.') failed %e\n", errno);
werror("io.c: fchdir(`.') failed: %e.\n", errno);
close(old_cd);
return -1;
}
......@@ -991,8 +991,8 @@ lsh_pushd(const char *directory,
if ( (mkdir(directory, 0700) < 0)
&& (errno != EEXIST) )
{
werror("io.c: Creating directory %z failed "
"%e\n", directory, errno);
werror("io.c: Creating directory %z failed: %e.\n",
directory, errno);
}
}
......@@ -1004,8 +1004,8 @@ lsh_pushd(const char *directory,
if (fstat(fd, &sbuf) < 0)
{
werror("io.c: Failed to stat `%z'.\n"
" %e\n", directory, errno);
werror("io.c: Failed to stat `%z': %e.\n",
directory, errno);
close(fd);
return -1;
}
......@@ -1053,7 +1053,7 @@ lsh_pushd(const char *directory,
while (fchdir(old_cd) < 0)
if (errno != EINTR)
{
werror("io.c: fchdir(\".\") failed %e\n", errno);
werror("io.c: fchdir(\".\") failed: %e.\n", errno);
close(fd);
close(old_cd);
return -1;
......@@ -1091,7 +1091,7 @@ io_bind_sockaddr(struct sockaddr *addr, socklen_t addr_length)
return -1;
if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char*)&yes, sizeof(yes)) < 0)
werror("setsockopt failed: %e\n", errno);
werror("setsockopt failed: %e.\n", errno);
if (bind(fd, addr, addr_length) < 0)
{
......@@ -1144,7 +1144,7 @@ io_bind_local(const struct local_info *info)
if ( (unlink(cname) < 0)
&& (errno != ENOENT))
{
werror("io.c: unlink '%S'/'%S' failed %e\n",
werror("io.c: unlink '%S'/'%S' failed: %e.\n",
info->directory, info->name, errno);
lsh_popd(old_cd, cdir);
return -1;
......@@ -1233,12 +1233,12 @@ lsh_make_pipe(int *fds)
if (SHUTDOWN_UNIX(fds[0], SHUT_WR) < 0)
{
werror("shutdown(%i, SHUT_WR) failed %e\n", fds[0], errno);
werror("shutdown(%i, SHUT_WR) failed: %e.\n", fds[0], errno);
goto fail;
}
if (SHUTDOWN_UNIX(fds[1], SHUT_RD) < 0)
{
werror("shutdown(%i, SHUT_RD) failed %e\n", fds[0], errno);
werror("shutdown(%i, SHUT_RD) failed: %e.\n", fds[0], errno);
fail:
{
int saved_errno = errno;
......@@ -1283,12 +1283,12 @@ lsh_popen_read(const char *program, const char **argv, int in,
/* Child */
if (dup2(in, STDIN_FILENO) < 0)
{
werror("lsh_popen: dup2 for stdin failed %e.\n", errno);
werror("lsh_popen: dup2 for stdin failed: %e.\n", errno);
_exit(EXIT_FAILURE);
}
if (dup2(out[1], STDOUT_FILENO) < 0)
{
werror("lsh_popen: dup2 for stdout failed %e.\n", errno);
werror("lsh_popen: dup2 for stdout failed: %e.\n", errno);
_exit(EXIT_FAILURE);
}
......@@ -1299,7 +1299,7 @@ lsh_popen_read(const char *program, const char **argv, int in,
/* The execv prototype uses const in the wrong way */
execv(program, (char **) argv);
werror("lsh_popen_read: execv `%z' failed %e.\n", program, errno);
werror("lsh_popen_read: execv `%z' failed: %e.\n", program, errno);
_exit(EXIT_FAILURE);
}
......@@ -1316,7 +1316,7 @@ lsh_popen_read(const char *program, const char **argv, int in,
if (waitpid(pid, &status, 0) < 0)
{
werror("lsh_popen_read: waitpid failed: %e\n", errno);
werror("lsh_popen_read: waitpid failed: %e.\n", errno);
lsh_string_free(s);
return NULL;
}
......@@ -1369,12 +1369,12 @@ lsh_popen_write(const char *program, const char **argv, int out,
/* Child */
if (dup2(fds[0], STDIN_FILENO) < 0)
{
werror("lsh_popen: dup2 for stdin failed %e.\n", errno);
werror("lsh_popen: dup2 for stdin failed: %e.\n", errno);
_exit(EXIT_FAILURE);
}
if (dup2(out, STDOUT_FILENO) < 0)
{
werror("lsh_popen: dup2 for stdout failed %e.\n", errno);
werror("lsh_popen: dup2 for stdout failed: %e.\n", errno);
_exit(EXIT_FAILURE);
}
......@@ -1385,7 +1385,7 @@ lsh_popen_write(const char *program, const char **argv, int out,
/* The execv prototype uses const in the wrong way */
execv(program, (char **) argv);
werror("lsh_popen_write: execv `%z' failed %e.\n", program, errno);
werror("lsh_popen_write: execv `%z' failed: %e.\n", program, errno);
_exit(EXIT_FAILURE);
}
......@@ -1402,7 +1402,7 @@ lsh_popen_write(const char *program, const char **argv, int out,
if (waitpid(pid, &status, 0) < 0)
{
werror("lsh_popen_write: waitpid failed: %e\n", errno);
werror("lsh_popen_write: waitpid failed: %e.\n", errno);
return 0;
}
......
......@@ -186,7 +186,7 @@ int main(int argc, char **argv)
O_WRONLY | O_CREAT, 0666);
if (out < 0)
{
werror("Failed to open file `%S' for writing %e\n",
werror("Failed to open file `%S' for writing: %e.\n",
options->file, errno);
return EXIT_FAILURE;
}
......@@ -195,7 +195,7 @@ int main(int argc, char **argv)
input = io_read_file_raw(STDIN_FILENO, 3000);
if (!input)
{
werror("Failed to read stdin %e\n", errno);
werror("Failed to read stdin: %e.\n", errno);
return EXIT_FAILURE;
}
......@@ -222,7 +222,7 @@ int main(int argc, char **argv)
if (!write_raw(out, STRING_LD(output)))
{
werror("Write failed: %e\n", errno);
werror("Write failed: %e.\n", errno);
return EXIT_FAILURE;
}
lsh_string_free(output);
......
......@@ -188,7 +188,7 @@ main(int argc, char **argv)
if (!input)
{
werror("Failed to read key %e\n", errno);
werror("Failed to read key: %e.\n", errno);
return EXIT_FAILURE;
}
......@@ -207,7 +207,7 @@ main(int argc, char **argv)
if (!write_raw(options->out_fd, STRING_LD(output)))
{
werror("Writing decrypted key failed: %e\n", errno);
werror("Writing decrypted key failed: %e.\n", errno);
return EXIT_FAILURE;
}
lsh_string_free(output);
......
......@@ -373,7 +373,7 @@ int main(int argc, char **argv)
in = open(options->infile, O_RDONLY);
if (in < 0)
{
werror("Failed to open '%z' for reading %e\n",
werror("Failed to open '%z' for reading: %e.\n",
options->infile, errno);
return EXIT_FAILURE;
}
......@@ -385,7 +385,7 @@ int main(int argc, char **argv)
O_WRONLY | O_CREAT, 0666);
if (out < 0)
{
werror("Failed to open '%z' for writing %e\n",
werror("Failed to open '%z' for writing: %e.\n",
options->outfile, errno);
return EXIT_FAILURE;
}
......@@ -396,7 +396,7 @@ int main(int argc, char **argv)
if (!input)
{
werror("Failed to read '%z' %e\n",
werror("Failed to read '%z': %e.\n",
options->infile, errno);
return EXIT_FAILURE;
}
......@@ -409,7 +409,7 @@ int main(int argc, char **argv)
if (!write_raw(out, STRING_LD(output)))
{
werror("Write failed: %e\n", errno);
werror("Write failed: %e.\n", errno);
return EXIT_FAILURE;
}
lsh_string_free(output);
......
......@@ -486,7 +486,7 @@ open_file(const struct lsh_string *file)
0600);
if (fd < 0)
werror("Failed to open `%S'for writing %e\n", file, errno);
werror("Failed to open `%S'for writing: %e.\n", file, errno);
return fd;
}
......@@ -604,7 +604,7 @@ main(int argc, char **argv)
private = io_read_file_raw(STDIN_FILENO, 2000);
if (!private)
{
werror("Failed to read key from stdin %e\n", errno);
werror("Failed to read key from stdin: %e.\n", errno);
return EXIT_FAILURE;
}
}
......@@ -643,7 +643,7 @@ main(int argc, char **argv)
if (!write_raw(public_fd, STRING_LD(public)))
{
werror("Writing public key failed: %e\n", errno);
werror("Writing public key failed: %e.\n", errno);
return EXIT_FAILURE;
}
lsh_string_free(public);
......@@ -656,7 +656,7 @@ main(int argc, char **argv)
if (!write_raw(private_fd, STRING_LD(private)))
{
werror("Writing private key failed: %e\n", errno);
werror("Writing private key failed: %e.\n", errno);
return EXIT_FAILURE;
}
......
......@@ -260,7 +260,7 @@ get_dev_random(struct yarrow256_ctx *ctx, enum source_type source)
while ( (res < 0) && (errno == EINTR));
if (res < 0)
werror("Reading from %z failed %e\n",
werror("Reading from %z failed: %e.\n",
names[i], errno);
else if (res > 0)
......@@ -453,7 +453,7 @@ spawn_source_process(unsigned *index,
{
if (access(system_sources[i].path, X_OK) < 0)
{
debug("unix_random.c: spawn_source_process: Skipping '%z'; not executable %e\n",
debug("unix_random.c: spawn_source_process: Skipping '%z'; not executable: %e.\n",
system_sources[i].path, errno);
i++;
}
......@@ -469,7 +469,7 @@ spawn_source_process(unsigned *index,
if (!lsh_make_pipe(output))
{
werror("spawn_source_process: Can't create pipe %e\n", errno);
werror("spawn_source_process: Can't create pipe: %e.\n", errno);
return 0;
}
......@@ -519,32 +519,32 @@ spawn_source_process(unsigned *index,
{
if (setgroups(0, NULL) < 0)
{
werror("Failed to clear supplimentary groups list %e\n", errno);
werror("Failed to clear supplimentary groups list: %e.\n", errno);
_exit(EXIT_FAILURE);
}
if (setgid(gid) < 0)
{
werror("Failed to change gid %e\n", errno);
werror("Failed to change gid: %e.\n", errno);
_exit(EXIT_FAILURE);
}
if (setuid(uid) < 0)
{
werror("Failed to change uid %e\n", errno);
werror("Failed to change uid: %e.\n", errno);
_exit(EXIT_FAILURE);
}
}
if (dup2(output[1], STDOUT_FILENO) < 0)
{
werror("spawn_source_process: dup2 for stdout failed %e\n", errno);
werror("spawn_source_process: dup2 for stdout failed: %e.\n", errno);
_exit(EXIT_FAILURE);
}
/* Ignore stderr. */
if (dup2(dev_null, STDERR_FILENO) < 0)
{
werror("spawn_source_process: dup2 for stderr failed %e\n", errno);
werror("spawn_source_process: dup2 for stderr failed: %e.\n", errno);
_exit(EXIT_FAILURE);
}
......@@ -556,7 +556,7 @@ spawn_source_process(unsigned *index,
execl(state->source->path, state->source->path,
state->source->arg, NULL);
werror("spawn_source_process: execl '%z' failed %e\n",
werror("spawn_source_process: execl '%z' failed: %e.\n",
state->source->path, errno);
_exit(EXIT_FAILURE);
......@@ -661,7 +661,7 @@ get_system(struct yarrow256_ctx *ctx, enum source_type source)
if (dev_null < 0)
{
werror("Failed to open /dev/null %e\n", errno);
werror("Failed to open /dev/null: %e.\n", errno);
return;
}
......@@ -669,7 +669,7 @@ get_system(struct yarrow256_ctx *ctx, enum source_type source)
unique.pid = getpid();
if (gettimeofday(&unique.now, NULL) < 0)
{
werror("getimeofday failed %e\n", errno);
werror("getimeofday failed: %e.\n", errno);
return;
}
......@@ -716,7 +716,7 @@ get_system(struct yarrow256_ctx *ctx, enum source_type source)
if (res < 0)
{
werror("get_system: select failed %e\n", errno);
werror("get_system: select failed: %e.\n", errno);
break;
}
......@@ -765,7 +765,7 @@ get_system(struct yarrow256_ctx *ctx, enum source_type source)
if (res < 0)
{
werror("get_system: read failed %e\n", errno);
werror("get_system: read failed: %e.\n", errno);
return;
}
else if (res > 0)
......@@ -811,7 +811,7 @@ get_system(struct yarrow256_ctx *ctx, enum source_type source)
if (waitpid(state[i].pid, &status, 0) < 0)
{
werror("waitpid failed %e\n", errno);
werror("waitpid failed: %e.\n", errno);
return;
}
if (WIFEXITED(status))
......@@ -853,7 +853,7 @@ get_system(struct yarrow256_ctx *ctx, enum source_type source)
while (res < 0 && errno == EINTR);
if (res < 0)
werror("Reading %z failed %e\n",
werror("Reading %z failed: %e.\n",
linux_proc_sources[i].name, errno);
else
{
......@@ -891,14 +891,14 @@ get_time_accuracy(void)
if (gettimeofday(&start, NULL))
{
werror("gettimeofday failed %e\n", errno);
werror("gettimeofday failed: %e.\n", errno);
return 0;
}
do
if (gettimeofday(&next, NULL))
{
werror("gettimeofday failed %e\n", errno);
werror("gettimeofday failed: %e.\n", errno);
return 0;
}
......@@ -976,7 +976,7 @@ get_interact(struct yarrow256_ctx *ctx, enum source_type source)
event.c = getchar();
if (gettimeofday(&event.now, NULL) < 0)
{
werror("gettimeofday failed %e\n", errno);
werror("gettimeofday failed: %e.\n", errno);
return;
}
......@@ -1054,7 +1054,7 @@ main(int argc, char **argv)
&& (mkdir(lsh_get_cstring(options->directory), 0755) < 0)
&& (errno != EEXIST) )
{
werror("Creating `%S' failed %e.\n",
werror("Creating `%S' failed: %e.\n",
options->directory, errno);
return EXIT_FAILURE;
}
......@@ -1118,7 +1118,7 @@ main(int argc, char **argv)
if (fd < 0)
{
werror("Failed to open file `%S' %e\n",
werror("Failed to open file `%S': %e.\n",
options->filename, errno);
return EXIT_FAILURE;
......@@ -1147,7 +1147,7 @@ main(int argc, char **argv)
/* FIXME: Use O_TRUNC instead? */
if (ftruncate(fd, 0) < 0)
{
werror("Failed to truncate file `%S' %e\n",
werror("Failed to truncate file `%S': %e.\n",
options->filename, errno);
goto error;
}
......
......@@ -722,7 +722,7 @@ start_service(struct lsh_transport_connection *self UNUSED)
/* Write hello message */
if (!write_raw (STDOUT_FILENO, sizeof(hello), hello))
{
werror ("Writing local hello message failed: %e\n", errno);
werror ("Writing local hello message failed: %e.\n", errno);
exit (EXIT_FAILURE);
}
......@@ -815,7 +815,7 @@ read_user_key(struct lsh_transport_config *config)
{
fd = open(config->identity, O_RDONLY);
if (fd < 0)
verbose("Failed to open `%z' for reading %e\n",
verbose("Failed to open `%z' for reading: %e.\n",
config->identity, errno);
}
else
......@@ -823,7 +823,7 @@ read_user_key(struct lsh_transport_config *config)
tmp = ssh_format("%lz/.lsh/identity", config->home);
fd = open(lsh_get_cstring(tmp), O_RDONLY);
if (fd < 0)
werror("Failed to open `%S' for reading %e\n",
werror("Failed to open `%S' for reading: %e.\n",
tmp, errno);
lsh_string_free(tmp);
}
......@@ -835,7 +835,7 @@ read_user_key(struct lsh_transport_config *config)
if (!contents)
{
werror("Failed to read private key file: %e\n", errno);
werror("Failed to read private key file: %e.\n", errno);
close(fd);
return NULL;
......@@ -1109,7 +1109,7 @@ read_host_acls(struct lsh_transport_lookup_verifier *self,
{
if (errno == ENOENT)
{
verbose("Failed to open `%z' for reading: %e\n", file, errno);
verbose("Failed to open `%z' for reading: %e.\n", file, errno);
if (!self->config->host_acls)
{
struct stat sbuf;
......@@ -1128,7 +1128,7 @@ read_host_acls(struct lsh_transport_lookup_verifier *self,
}
}
else
werror("Failed to open `%z' for reading: %e\n",
werror("Failed to open `%z' for reading: %e.\n",
file, errno);
return;
}
......@@ -1139,7 +1139,7 @@ read_host_acls(struct lsh_transport_lookup_verifier *self,
if (!contents)
{
werror("Failed to read host-acls file `%z': %e\n",
werror("Failed to read host-acls file `%z': %e.\n",
file, errno);
close(fd);
return;
......@@ -1277,7 +1277,7 @@ main_argp_parser(int key, char *arg, struct argp_state *state)
self->capture_fd = open(host_db_update,
O_WRONLY | O_APPEND | O_CREAT, 0600);
if (self->capture_fd < 0)
werror("Opening `%z' for writing failed: %e\n",
werror("Opening `%z' for writing failed: %e.\n",
host_db_update, errno);
}
lsh_string_free(host_acls);
......
......@@ -266,7 +266,7 @@ make_client_session(struct lsh_options *options,
if (in < 0)
{
werror("Can't open stdin %e\n", errno);
werror("Can't open stdin: %e.\n", errno);
return NULL;
}
......@@ -294,7 +294,7 @@ make_client_session(struct lsh_options *options,
if (out < 0)
{
werror("Can't open stdout %e\n", errno);
werror("Can't open stdout: %e.\n", errno);
close(in);
return NULL;