aboutsummaryrefslogtreecommitdiff
path: root/login
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2017-07-03 14:39:52 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2017-08-18 10:53:47 -0300
commitc647fb885cb678471f6b6a66f394b4ca5515a016 (patch)
tree5c6bd65b90aaf1dbe66e1f98df74906fcf275454 /login
parenta748eb31c137e9b69c3d81765271a544f93f8fe5 (diff)
downloadglibc-c647fb885cb678471f6b6a66f394b4ca5515a016.zip
glibc-c647fb885cb678471f6b6a66f394b4ca5515a016.tar.gz
glibc-c647fb885cb678471f6b6a66f394b4ca5515a016.tar.bz2
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.
Diffstat (limited to 'login')
-rw-r--r--login/utmp_file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/login/utmp_file.c b/login/utmp_file.c
index 61d03d6..26e3f4b 100644
--- a/login/utmp_file.c
+++ b/login/utmp_file.c
@@ -444,7 +444,7 @@ pututline_file (const struct utmp *data)
}
/* Write the new data. */
- if (write_not_cancel (file_fd, data, sizeof (struct utmp))
+ if (__write_nocancel (file_fd, data, sizeof (struct utmp))
!= sizeof (struct utmp))
{
/* If we appended a new record this is only partially written.
@@ -505,7 +505,7 @@ updwtmp_file (const char *file, const struct utmp *utmp)
/* Write the entry. If we can't write all the bytes, reset the file
size back to the original size. That way, no partial entries
will remain. */
- if (write_not_cancel (fd, utmp, sizeof (struct utmp))
+ if (__write_nocancel (fd, utmp, sizeof (struct utmp))
!= sizeof (struct utmp))
{
__ftruncate64 (fd, offset);