Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2008-07-30 08:58:24 +0400
committerChristopher Faylor <me@cgf.cx>2008-07-30 08:58:24 +0400
commita010e6abed2c84e302823c4403ef3782b34bb6f1 (patch)
tree85d4a3bc4bc26912d44e8a2486db84fcb7efef03 /winsup/cygwin/syscalls.cc
parentdbfc6f0e7853822a87fb2521f71a856b02c60875 (diff)
* 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.
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r--winsup/cygwin/syscalls.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index a8a66ecbf..92446bcc0 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -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;