From 9a737ab7a40984cfdfffd014562a220a3736a10f Mon Sep 17 00:00:00 2001 From: Austin Foxley Date: Sat, 17 Oct 2009 14:25:01 -0700 Subject: use *_not_cancel variants to avoid accidental cancellations with nptl Signed-off-by: Austin Foxley --- libc/misc/utmp/wtent.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'libc/misc/utmp/wtent.c') diff --git a/libc/misc/utmp/wtent.c b/libc/misc/utmp/wtent.c index e73d99feb..5ab743d9b 100644 --- a/libc/misc/utmp/wtent.c +++ b/libc/misc/utmp/wtent.c @@ -13,6 +13,7 @@ #include #include #include +#include #if 0 /* This is enabled in uClibc/libutil/logwtmp.c */ @@ -36,12 +37,12 @@ void updwtmp(const char *wtmp_file, const struct utmp *lutmp) { int fd; - fd = open(wtmp_file, O_APPEND | O_WRONLY); + fd = open_not_cancel(wtmp_file, O_APPEND | O_WRONLY, 0); if (fd >= 0) { if (lockf(fd, F_LOCK, 0) == 0) { - write(fd, lutmp, sizeof(*lutmp)); + write_not_cancel(fd, lutmp, sizeof(struct utmp)); lockf(fd, F_ULOCK, 0); - close(fd); + close_not_cancel_no_status(fd); } } } -- cgit v1.2.3