summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2012-08-20 14:14:00 (GMT)
committerdgp <dgp@users.sourceforge.net>2012-08-20 14:14:00 (GMT)
commit56ab72d069fc6871ecfd285bb07e4670bcc5db4a (patch)
tree7a0312e58d298d09068fef5d9311e409cd47f771 /unix
parent23754cbbc81ac0eda71610fe3737a8bc8ae31c65 (diff)
parenteb9bcac9c6ae30bb3e5f6bc298ee8238927a93e1 (diff)
downloadtcl-56ab72d069fc6871ecfd285bb07e4670bcc5db4a.zip
tcl-56ab72d069fc6871ecfd285bb07e4670bcc5db4a.tar.gz
tcl-56ab72d069fc6871ecfd285bb07e4670bcc5db4a.tar.bz2
merge trunk
Diffstat (limited to 'unix')
-rw-r--r--unix/tclUnixCompat.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/unix/tclUnixCompat.c b/unix/tclUnixCompat.c
index 3818121..e201018 100644
--- a/unix/tclUnixCompat.c
+++ b/unix/tclUnixCompat.c
@@ -99,12 +99,20 @@ static Tcl_Mutex compatLock;
#undef NEED_COPYPWD
#undef NEED_COPYSTRING
+#if !defined(HAVE_GETGRNAM_R_5) && !defined(HAVE_GETGRNAM_R_4)
+#define NEED_COPYGRP 1
+static int CopyGrp(struct group *tgtPtr, char *buf, int buflen);
+#endif
+
+#if !defined(HAVE_GETPWNAM_R_5) && !defined(HAVE_GETPWNAM_R_4)
+#define NEED_COPYPWD 1
+static int CopyPwd(struct passwd *tgtPtr, char *buf, int buflen);
+#endif
+
static int CopyArray(char **src, int elsize, char *buf,
int buflen);
-static int CopyGrp(struct group *tgtPtr, char *buf, int buflen);
static int CopyHostent(struct hostent *tgtPtr, char *buf,
int buflen);
-static int CopyPwd(struct passwd *tgtPtr, char *buf, int buflen);
static int CopyString(const char *src, char *buf, int buflen);
#endif
@@ -214,7 +222,6 @@ TclpGetPwNam(
return getpwnam_r(name, &tsdPtr->pwd, tsdPtr->pbuf, sizeof(tsdPtr->pbuf));
#else
-#define NEED_COPYPWD 1
struct passwd *pwPtr;
Tcl_MutexLock(&compatLock);
@@ -295,7 +302,6 @@ TclpGetPwUid(
return getpwuid_r(uid, &tsdPtr->pwd, tsdPtr->pbuf, sizeof(tsdPtr->pbuf));
#else
-#define NEED_COPYPWD 1
struct passwd *pwPtr;
Tcl_MutexLock(&compatLock);
@@ -364,7 +370,7 @@ TclpGetGrNam(
#else
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
-#ifdef HAVE_GETGRNAM_R_5
+#if defined(HAVE_GETGRNAM_R_5)
struct group *grPtr = NULL;
/*
@@ -399,7 +405,6 @@ TclpGetGrNam(
return getgrnam_r(name, &tsdPtr->grp, tsdPtr->gbuf, sizeof(tsdPtr->gbuf));
#else
-#define NEED_COPYGRP 1
struct group *grPtr;
Tcl_MutexLock(&compatLock);
@@ -480,7 +485,6 @@ TclpGetGrGid(
return getgrgid_r(gid, &tsdPtr->grp, tsdPtr->gbuf, sizeof(tsdPtr->gbuf));
#else
-#define NEED_COPYGRP 1
struct group *grPtr;
Tcl_MutexLock(&compatLock);