* 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:
Christopher Faylor
2008-07-30 04:58:24 +00:00
parent dbfc6f0e78
commit a010e6abed
6 changed files with 36 additions and 16 deletions

View File

@@ -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;