summaryrefslogtreecommitdiffstats
path: root/libc/misc/utmp/wtent.c
diff options
context:
space:
mode:
authorAustin Foxley <austinf@cetoncorp.com>2009-09-21 18:25:22 -0700
committerAustin Foxley <austinf@cetoncorp.com>2009-09-21 18:25:22 -0700
commite2784760e51ec0de62bbee61d27a85147460ece0 (patch)
tree0d1541dc5f16424d5a097929e0aaaa8c762a1056 /libc/misc/utmp/wtent.c
parenta894902293392cdae3a614ae3ff065ca3a7b9f75 (diff)
downloaduClibc-alpine-e2784760e51ec0de62bbee61d27a85147460ece0.tar.bz2
uClibc-alpine-e2784760e51ec0de62bbee61d27a85147460ece0.tar.xz
not-cancel: use *_not_cancel variants directly
add a no threads version of not-cancel.h to fallback on Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
Diffstat (limited to 'libc/misc/utmp/wtent.c')
-rw-r--r--libc/misc/utmp/wtent.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/libc/misc/utmp/wtent.c b/libc/misc/utmp/wtent.c
index 9b2763701..5ab743d9b 100644
--- a/libc/misc/utmp/wtent.c
+++ b/libc/misc/utmp/wtent.c
@@ -13,10 +13,7 @@
#include <utmp.h>
#include <fcntl.h>
#include <sys/file.h>
-#ifdef __UCLIBC_HAS_THREADS_NATIVE__
-#include <errno.h>
#include <not-cancel.h>
-#endif
#if 0
/* This is enabled in uClibc/libutil/logwtmp.c */
@@ -40,7 +37,6 @@ void updwtmp(const char *wtmp_file, const struct utmp *lutmp)
{
int fd;
-#ifdef __UCLIBC_HAS_THREADS_NATIVE__
fd = open_not_cancel(wtmp_file, O_APPEND | O_WRONLY, 0);
if (fd >= 0) {
if (lockf(fd, F_LOCK, 0) == 0) {
@@ -49,14 +45,4 @@ void updwtmp(const char *wtmp_file, const struct utmp *lutmp)
close_not_cancel_no_status(fd);
}
}
-#else
- fd = open(wtmp_file, O_APPEND | O_WRONLY);
- if (fd >= 0) {
- if (lockf(fd, F_LOCK, 0) == 0) {
- write(fd, lutmp, sizeof(*lutmp));
- lockf(fd, F_ULOCK, 0);
- close(fd);
- }
- }
-#endif
}