diff options
author | luther <luther@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-01-23 20:59:18 +0000 |
---|---|---|
committer | luther <luther@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-01-23 20:59:18 +0000 |
commit | 5385a98f5e58960435db2ec334128b5d0bfad4dd (patch) | |
tree | fe7943711537fcf9677f5a79dff9c6aa734e7847 /PACE | |
parent | e6fbc8bc442017b9f236c4d84fcb260f186d94b0 (diff) | |
download | ATCD-5385a98f5e58960435db2ec334128b5d0bfad4dd.tar.gz |
Tue Jan 23 14:56:51 2001 Luther J Baker <luther@cs.wustl.edu>
Diffstat (limited to 'PACE')
-rw-r--r-- | PACE/ChangeLog | 8 | ||||
-rw-r--r-- | PACE/pace/posix/unistd.inl | 14 |
2 files changed, 17 insertions, 5 deletions
diff --git a/PACE/ChangeLog b/PACE/ChangeLog index a93c75fff5b..ba3ff85775e 100644 --- a/PACE/ChangeLog +++ b/PACE/ChangeLog @@ -1,3 +1,11 @@ +Tue Jan 23 14:56:51 2001 Luther J Baker <luther@cs.wustl.edu> + + * pace/posix/unistd.inl (pace_getlogin_r): + + Rewrote code and based preprocessor selection on + PACE_HAS_REENTRANT as opposed to PACE_LYNXOS, PACE_SUNOS + on an otherwise defined platform macro. + Fri Jan 19 12:43:27 2001 Priyanka Gontla <pgontla@ece.uci.edu> * pace/posix/socket.h: diff --git a/PACE/pace/posix/unistd.inl b/PACE/pace/posix/unistd.inl index c4086a29a6b..fe0a236440b 100644 --- a/PACE/pace/posix/unistd.inl +++ b/PACE/pace/posix/unistd.inl @@ -227,12 +227,16 @@ PACE_INLINE int pace_getlogin_r (char * name, size_t namesize) { -#if (PACE_SUNOS) || (PACE_LYNXOS) - if (getlogin_r (name, (int) namesize) == 0) - return errno; - return 0; -#else +#if (PACE_HAS_REENTRANT) + // supported call return getlogin_r (name, namesize); +#else + // unsupported call (emulated) + // careful, emulation is not reentrant safe + char * retval = getlogin (); + if (0 == retval) + return errno; + return retval; #endif /* SUN_OS */ } #endif /* PACE_HAS_POSIX_UGR_UOF */ |