drop use of strerror()

It isn't thread-safe. Use the %m conversion specifier instead,
like the rest of the code already does.
This commit is contained in:
Dylan Noblesmith 2012-06-15 22:01:06 +00:00
parent bb6e48b1b0
commit cadd999292
2 changed files with 2 additions and 2 deletions

View file

@ -1086,7 +1086,7 @@ int main(int argc, char *argv[])
buf = XML_GetBuffer(ctx.parser, XML_BUFFER_SIZE);
len = fread(buf, 1, XML_BUFFER_SIZE, stdin);
if (len < 0) {
fprintf(stderr, "fread: %s\n", strerror(errno));
fprintf(stderr, "fread: %m\n");
exit(EXIT_FAILURE);
}
XML_ParseBuffer(ctx.parser, len, len == 0);

View file

@ -1102,7 +1102,7 @@ socket_data(int fd, uint32_t mask, void *data)
client_fd = wl_os_accept_cloexec(fd, (struct sockaddr *) &name,
&length);
if (client_fd < 0)
wl_log("failed to accept, errno: %d\n", errno);
wl_log("failed to accept: %m\n");
else
wl_client_create(display, client_fd);