mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-28 00:21:52 +03:00
Consolidate non cancellable write call
This patch consolidates all the non cancellable write calls to use the __write_nocancel identifier. For non cancellable targets it will be just a macro to call the default respective symbol while on Linux will be a internal one. Checked on x86_64-linux-gnu, x86_64-linux-gnu-x32, and i686-linux-gnu. * sysdeps/generic/not-cancel.h (write_not_cancel): Remove macro. (__write_nocancel): New macro. * sysdeps/unix/sysv/linux/not-cancel.h (__write_nocancel): Rewrite as a function prototype. (write_not_cancel): Remove macro. * sysdeps/unix/sysv/linux/write.c (__write_nocancel): New function. * gmon/gmon.c (ERR): Replace write_not_cancel with __write_nocancel. (write_gmon): Likewise. * libio/fileops.c (_IO_new_file_write): Likewise. * login/utmp_file.c (pututline_file): Likewise. (updwtmp_file): Likewise. * stdio-common/psiginfo.c (psiginfo): Likewise. * sysdeps/posix/spawni.c (__spawni_child): Likewise. * sysdeps/unix/sysv/linux/gethostid.c (sethostid): Likewise. * sysdeps/unix/sysv/linux/libc_fatal.c (backtrace_and_maps): Likewise. * sysdeps/unix/sysv/linux/pthread_setname.c (pthread_setname_np): Likewise.
This commit is contained in:
@ -48,7 +48,7 @@ backtrace_and_maps (int do_abort, bool written, int fd)
|
||||
if (n > 2)
|
||||
{
|
||||
#define strnsize(str) str, strlen (str)
|
||||
#define writestr(str) write_not_cancel (fd, str)
|
||||
#define writestr(str) __write_nocancel (fd, str)
|
||||
writestr (strnsize ("======= Backtrace: =========\n"));
|
||||
__backtrace_symbols_fd (addrs + 1, n - 1, fd);
|
||||
|
||||
@ -57,7 +57,7 @@ backtrace_and_maps (int do_abort, bool written, int fd)
|
||||
char buf[1024];
|
||||
ssize_t n2;
|
||||
while ((n2 = __read_nocancel (fd2, buf, sizeof (buf))) > 0)
|
||||
if (write_not_cancel (fd, buf, n2) != n2)
|
||||
if (__write_nocancel (fd, buf, n2) != n2)
|
||||
break;
|
||||
close_not_cancel_no_status (fd2);
|
||||
}
|
||||
|
Reference in New Issue
Block a user