Fix the _XGetpwnam macro to be more consistent; this patch by Robert Millan. --- xproto-7.0/Xos_r.h.old 2003-04-11 14:54:50.000000000 +0200 +++ xproto-7.0/Xos_r.h 2003-04-11 12:56:19.000000000 +0200 @@ -217,8 +217,8 @@ * * typedef ... _Xgetpwparams; * - * struct passwd* _XGetpwnam(const char *name, _Xgetpwparams); - * struct passwd* _XGetpwuid(uid_t uid, _Xgetpwparams); + * struct passwd* _XGetpwnam(const char *name, _Xgetpwparams, struct **dummy); + * struct passwd* _XGetpwuid(uid_t uid, _Xgetpwparams, struct **dummy); */ #if defined(X_INCLUDE_PWD_H) && !defined(_XOS_INCLUDED_PWD_H) @@ -238,8 +238,8 @@ extern struct passwd *getpwuid(), *getpwnam(); # endif typedef int _Xgetpwparams; /* dummy */ -# define _XGetpwuid(u,p) getpwuid((u)) -# define _XGetpwnam(u,p) getpwnam((u)) +# define _XGetpwuid(u,p,s) getpwuid((u)) +# define _XGetpwnam(u,p,s) getpwnam((u)) #elif !defined(XOS_USE_MTSAFE_PWDAPI) || defined(XNO_MTSAFE_PWDAPI) /* UnixWare 2.0, or other systems with thread support but no _r API. */ @@ -316,12 +316,12 @@ ((p).pwp = &(p).pws), \ 0 ) #endif -# define _XGetpwuid(u,p) \ +# define _XGetpwuid(u,p,s) \ ( (_Xos_processLock), \ (((p).pwp = getpwuid((u))) ? _Xpw_copyPasswd(p), 0 : 0), \ (_Xos_processUnlock), \ (p).pwp ) -# define _XGetpwnam(u,p) \ +# define _XGetpwnam(u,p,s) \ ( (_Xos_processLock), \ (((p).pwp = getpwnam((u))) ? _Xpw_copyPasswd(p), 0 : 0), \ (_Xos_processUnlock), \ @@ -336,21 +336,21 @@ } _Xgetpwparams; # if defined(_POSIX_REENTRANT_FUNCTIONS) || !defined(SVR4) || defined(Lynx) # ifndef Lynx -# define _XGetpwuid(u,p) \ -((getpwuid_r((u),&(p).pws,(p).pwbuf,sizeof((p).pwbuf)) == -1) ? NULL : &(p).pws) -# define _XGetpwnam(u,p) \ -((getpwnam_r((u),&(p).pws,(p).pwbuf,sizeof((p).pwbuf)) == -1) ? NULL : &(p).pws) +# define _XGetpwuid(u,p,s) \ +((getpwuid_r((u),&(p).pws,(p).pwbuf,sizeof((p).pwbuf),(s)) == -1) ? NULL : &(p).pws) +# define _XGetpwnam(u,p,s) \ +((getpwnam_r((u),&(p).pws,(p).pwbuf,sizeof((p).pwbuf),(s)) == -1) ? NULL : &(p).pws) # else /* Lynx */ -# define _XGetpwuid(u,p) \ -((getpwuid_r(&(p).pws,(u),(p).pwbuf,sizeof((p).pwbuf)) == -1) ? NULL : &(p).pws) -# define _XGetpwnam(u,p) \ -((getpwnam_r(&(p).pws,(u),(p).pwbuf,sizeof((p).pwbuf)) == -1) ? NULL : &(p).pws) +# define _XGetpwuid(u,p,s) \ +((getpwuid_r(&(p).pws,(u),(p).pwbuf,sizeof((p).pwbuf),(s)) == -1) ? NULL : &(p).pws) +# define _XGetpwnam(u,p,s) \ +((getpwnam_r(&(p).pws,(u),(p).pwbuf,sizeof((p).pwbuf),(s)) == -1) ? NULL : &(p).pws) # endif # else /* SVR4 */ -# define _XGetpwuid(u,p) \ -((getpwuid_r((u),&(p).pws,(p).pwbuf,sizeof((p).pwbuf)) == NULL) ? NULL : &(p).pws) -# define _XGetpwnam(u,p) \ -((getpwnam_r((u),&(p).pws,(p).pwbuf,sizeof((p).pwbuf)) == NULL) ? NULL : &(p).pws) +# define _XGetpwuid(u,p,s) \ +((getpwuid_r((u),&(p).pws,(p).pwbuf,sizeof((p).pwbuf),(s)) == NULL) ? NULL : &(p).pws) +# define _XGetpwnam(u,p,s) \ +((getpwnam_r((u),&(p).pws,(p).pwbuf,sizeof((p).pwbuf),(s)) == NULL) ? NULL : &(p).pws) # endif /* SVR4 */ #else /* _POSIX_THREAD_SAFE_FUNCTIONS */ @@ -367,10 +367,10 @@ struct passwd* pwp; } _Xgetpwparams; typedef int _Xgetpwret; -# define _XGetpwuid(u,p) \ +# define _XGetpwuid(u,p,s) \ ((getpwuid_r((u),&(p).pws,(p).pwbuf,sizeof((p).pwbuf),&(p).pwp) == 0) ? \ (p).pwp : NULL) -# define _XGetpwnam(u,p) \ +# define _XGetpwnam(u,p,s) \ ((getpwnam_r((u),&(p).pws,(p).pwbuf,sizeof((p).pwbuf),&(p).pwp) == 0) ? \ (p).pwp : NULL) #endif /* X_INCLUDE_PWD_H */