From 883d4fb97aee5522adc42a2fb660d34077d7ebb0 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Fri, 15 Mar 2002 12:35:14 +0000 Subject: Add missing updwtmp() and fix broken makefile --- libc/misc/utmp/Makefile | 4 ++-- libc/misc/utmp/utent.c | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/libc/misc/utmp/Makefile b/libc/misc/utmp/Makefile index a3ef79bc7..7a68f1175 100644 --- a/libc/misc/utmp/Makefile +++ b/libc/misc/utmp/Makefile @@ -35,8 +35,8 @@ $(LIBC): ar-target ar-target: $(OBJS) $(AR) $(ARFLAGS) $(LIBC) $(OBJS) -$(COBJS): - $(CC) $(CFLAGS) $< -c $*.c -o $*.o +$(COBJS): %.o : %.c + $(CC) $(CFLAGS) -c $< -o $@ $(STRIPTOOL) -x -R .note -R .comment $*.o clean: diff --git a/libc/misc/utmp/utent.c b/libc/misc/utmp/utent.c index 2746b0b35..8d816c548 100644 --- a/libc/misc/utmp/utent.c +++ b/libc/misc/utmp/utent.c @@ -134,3 +134,15 @@ int utmpname (const char *new_ut_name) close(ut_fd); return 0; } + +extern void updwtmp(const char *wtmp_file, const struct utmp *ut) +{ + int fd; + + fd = open(wtmp_file, O_APPEND | O_WRONLY, 0); + if (fd >= 0) { + write(fd, (const char *) ut, sizeof(*ut)); + close(fd); + } +} + -- cgit v1.2.3