mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-02 09:01:39 -05:00
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:
parent
bb6e48b1b0
commit
cadd999292
2 changed files with 2 additions and 2 deletions
|
|
@ -1086,7 +1086,7 @@ int main(int argc, char *argv[])
|
||||||
buf = XML_GetBuffer(ctx.parser, XML_BUFFER_SIZE);
|
buf = XML_GetBuffer(ctx.parser, XML_BUFFER_SIZE);
|
||||||
len = fread(buf, 1, XML_BUFFER_SIZE, stdin);
|
len = fread(buf, 1, XML_BUFFER_SIZE, stdin);
|
||||||
if (len < 0) {
|
if (len < 0) {
|
||||||
fprintf(stderr, "fread: %s\n", strerror(errno));
|
fprintf(stderr, "fread: %m\n");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
XML_ParseBuffer(ctx.parser, len, len == 0);
|
XML_ParseBuffer(ctx.parser, len, len == 0);
|
||||||
|
|
|
||||||
|
|
@ -1102,7 +1102,7 @@ socket_data(int fd, uint32_t mask, void *data)
|
||||||
client_fd = wl_os_accept_cloexec(fd, (struct sockaddr *) &name,
|
client_fd = wl_os_accept_cloexec(fd, (struct sockaddr *) &name,
|
||||||
&length);
|
&length);
|
||||||
if (client_fd < 0)
|
if (client_fd < 0)
|
||||||
wl_log("failed to accept, errno: %d\n", errno);
|
wl_log("failed to accept: %m\n");
|
||||||
else
|
else
|
||||||
wl_client_create(display, client_fd);
|
wl_client_create(display, client_fd);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue