* cygwin.din (_getutline): Remove.
* lib/bsdlib.cc (login): Make argument const as per linux. (logout): Ditto. * syscalls.cc (getutid): Ditto. (getutline): Ditto. (pututline): Ditto. (getutxent): Add comment mentioning non-thread-safety. (getutxid): Ditto. (getutxline): Ditto. (pututxline): Ditto. * sys/utmp.h: Declare arguments to various functions as const as per linux. Remove bogus _getutline definition.
This commit is contained in:
parent
dbfc6f0e78
commit
a010e6abed
@ -1,3 +1,18 @@
|
||||
2008-07-30 Christopher Faylor <me+cygwin@cgf.cx>
|
||||
|
||||
* cygwin.din (_getutline): Remove.
|
||||
* lib/bsdlib.cc (login): Make argument const as per linux.
|
||||
(logout): Ditto.
|
||||
* syscalls.cc (getutid): Ditto.
|
||||
(getutline): Ditto.
|
||||
(pututline): Ditto.
|
||||
(getutxent): Add comment mentioning non-thread-safety.
|
||||
(getutxid): Ditto.
|
||||
(getutxline): Ditto.
|
||||
(pututxline): Ditto.
|
||||
* sys/utmp.h: Declare arguments to various functions as const as per
|
||||
linux. Remove bogus _getutline definition.
|
||||
|
||||
2008-07-29 Christopher Faylor <me+cygwin@cgf.cx>
|
||||
|
||||
* include/cygwin/version.h: Add comment indicating that current API number
|
||||
|
@ -701,7 +701,6 @@ _getutent = getutent SIGFE
|
||||
getutid SIGFE
|
||||
_getutid = getutid SIGFE
|
||||
getutline SIGFE
|
||||
_getutline = getutline SIGFE
|
||||
getutxent SIGFE
|
||||
getutxid SIGFE
|
||||
getutxline SIGFE
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* sys/utmp.h
|
||||
|
||||
Copyright 2001, 2004 Red Hat, Inc.
|
||||
Copyright 2001, 2003, 2004, 2005, 2008 Red Hat, Inc.
|
||||
|
||||
This software is a copyrighted work licensed under the terms of the
|
||||
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
||||
@ -34,17 +34,16 @@ struct utmp
|
||||
long ut_addr;
|
||||
};
|
||||
|
||||
extern struct utmp *_getutline (struct utmp *);
|
||||
extern struct utmp *getutent (void);
|
||||
extern struct utmp *getutid (struct utmp *);
|
||||
extern struct utmp *getutline (struct utmp *);
|
||||
extern struct utmp *pututline (struct utmp *);
|
||||
extern struct utmp *getutid (const struct utmp *);
|
||||
extern struct utmp *getutline (const struct utmp *);
|
||||
extern struct utmp *pututline (const struct utmp *);
|
||||
extern void endutent (void);
|
||||
extern void setutent (void);
|
||||
extern void utmpname (const char *);
|
||||
|
||||
void login (struct utmp *);
|
||||
int logout (char *);
|
||||
void login (const struct utmp *);
|
||||
int logout (const char *);
|
||||
int login_tty (int);
|
||||
void updwtmp (const char *, const struct utmp *);
|
||||
void logwtmp (const char *, const char *, const char *);
|
||||
|
@ -271,7 +271,7 @@ logwtmp (const char *line, const char *user, const char *host)
|
||||
}
|
||||
|
||||
extern "C" void
|
||||
login (struct utmp *ut)
|
||||
login (const struct utmp *ut)
|
||||
{
|
||||
pututline (ut);
|
||||
endutent ();
|
||||
@ -279,7 +279,7 @@ login (struct utmp *ut)
|
||||
}
|
||||
|
||||
extern "C" int
|
||||
logout (char *line)
|
||||
logout (const char *line)
|
||||
{
|
||||
struct utmp ut_buf, *ut;
|
||||
|
||||
|
@ -506,7 +506,7 @@ out:
|
||||
fh->get_name ());
|
||||
else
|
||||
{
|
||||
#if 0
|
||||
#if 1
|
||||
/* FIXME: This code is not quite correct. There's no better solution
|
||||
so far but to make simple assumptions based on WriteQuotaAvailable. */
|
||||
|
||||
@ -531,7 +531,7 @@ out:
|
||||
that. This means that a pipe could still block since you could
|
||||
be trying to write more to the pipe than is available in the
|
||||
buffer but that is the hazard of select(). */
|
||||
else if (fpli.WriteQuotaAvailable)
|
||||
else if (fpli.WriteQuotaAvailable = (fpli.OutboundQuota - fpli.ReadDataAvailable))
|
||||
{
|
||||
select_printf ("%s, ready for write: size %lu, avail %lu",
|
||||
fh->get_name (),
|
||||
|
@ -3098,7 +3098,7 @@ getutent ()
|
||||
}
|
||||
|
||||
extern "C" struct utmp *
|
||||
getutid (struct utmp *id)
|
||||
getutid (const struct utmp *id)
|
||||
{
|
||||
myfault efault;
|
||||
if (efault.faulted (EFAULT))
|
||||
@ -3137,7 +3137,7 @@ getutid (struct utmp *id)
|
||||
}
|
||||
|
||||
extern "C" struct utmp *
|
||||
getutline (struct utmp *line)
|
||||
getutline (const struct utmp *line)
|
||||
{
|
||||
myfault efault;
|
||||
if (efault.faulted (EFAULT))
|
||||
@ -3160,7 +3160,7 @@ getutline (struct utmp *line)
|
||||
}
|
||||
|
||||
extern "C" struct utmp *
|
||||
pututline (struct utmp *ut)
|
||||
pututline (const struct utmp *ut)
|
||||
{
|
||||
myfault efault;
|
||||
if (efault.faulted (EFAULT))
|
||||
@ -3184,7 +3184,10 @@ pututline (struct utmp *ut)
|
||||
}
|
||||
else
|
||||
locked_append (utmp_fd, ut, sizeof *ut);
|
||||
return ut;
|
||||
/* The documentation says to return a pointer to this which implies that
|
||||
this has to be cast from a const. That doesn't seem right but the
|
||||
documentation seems pretty clear on this. */
|
||||
return (struct utmp *) ut;
|
||||
}
|
||||
|
||||
extern "C" void
|
||||
@ -3202,6 +3205,7 @@ endutxent ()
|
||||
extern "C" struct utmpx *
|
||||
getutxent ()
|
||||
{
|
||||
/* UGH. Not thread safe. */
|
||||
static struct utmpx utx;
|
||||
return copy_ut_to_utx (getutent (), &utx);
|
||||
}
|
||||
@ -3209,6 +3213,7 @@ getutxent ()
|
||||
extern "C" struct utmpx *
|
||||
getutxid (const struct utmpx *id)
|
||||
{
|
||||
/* UGH. Not thread safe. */
|
||||
static struct utmpx utx;
|
||||
|
||||
myfault efault;
|
||||
@ -3221,6 +3226,7 @@ getutxid (const struct utmpx *id)
|
||||
extern "C" struct utmpx *
|
||||
getutxline (const struct utmpx *line)
|
||||
{
|
||||
/* UGH. Not thread safe. */
|
||||
static struct utmpx utx;
|
||||
|
||||
myfault efault;
|
||||
@ -3233,6 +3239,7 @@ getutxline (const struct utmpx *line)
|
||||
extern "C" struct utmpx *
|
||||
pututxline (const struct utmpx *utmpx)
|
||||
{
|
||||
/* UGH. Not thread safe. */
|
||||
static struct utmpx utx;
|
||||
|
||||
myfault efault;
|
||||
|
Loading…
x
Reference in New Issue
Block a user