Index: head/editors/openoffice/files/patch-sal+osl+unx+system.c =================================================================== --- head/editors/openoffice/files/patch-sal+osl+unx+system.c (revision 79373) +++ head/editors/openoffice/files/patch-sal+osl+unx+system.c (revision 79374) @@ -1,127 +1,137 @@ ---- ../sal/osl/unx/system.c.orig Sun Mar 17 12:34:13 2002 -+++ ../sal/osl/unx/system.c Wed Apr 3 01:03:36 2002 -@@ -195,6 +195,73 @@ +--- ../sal/osl/unx/system.c.orig Tue Aug 20 08:49:46 2002 ++++ ../sal/osl/unx/system.c Sat Apr 19 22:15:25 2003 +@@ -74,7 +74,8 @@ + static pthread_mutex_t getrtl_mutex = PTHREAD_MUTEX_INITIALIZER; + + /* struct passwd differs on some platforms */ +-#if defined NETBSD || defined MACOSX || defined FREEBSD ++#if defined NETBSD || defined MACOSX || \ ++ (defined FREEBSD && (__FreeBSD_version < 500112)) + #include + #include + +@@ -203,6 +204,73 @@ } #endif +int getpwuid_r(uid_t uid, struct passwd *pwd, char *buffer, + size_t buflen, struct passwd **result) +{ + struct passwd* res; + + pthread_mutex_lock(&getrtl_mutex); + + if ( res = getpwuid(uid) ) + { + size_t pw_name, pw_passwd, pw_class, pw_gecos, pw_dir, pw_shell; + + pw_name = strlen(res->pw_name)+1; + pw_passwd = strlen(res->pw_passwd)+1; + pw_class = strlen(res->pw_class)+1; + pw_gecos = strlen(res->pw_gecos)+1; + pw_dir = strlen(res->pw_dir)+1; + pw_shell = strlen(res->pw_shell)+1; + + if (pw_name+pw_passwd+pw_class+pw_gecos + +pw_dir+pw_shell < buflen) + { + memcpy(pwd, res, sizeof(struct passwd)); + + strncpy(buffer, res->pw_name, pw_name); + pwd->pw_name = buffer; + buffer += pw_name; + + strncpy(buffer, res->pw_passwd, pw_passwd); + pwd->pw_passwd = buffer; + buffer += pw_passwd; + + strncpy(buffer, res->pw_class, pw_class); + pwd->pw_class = buffer; + buffer += pw_class; + + strncpy(buffer, res->pw_gecos, pw_gecos); + pwd->pw_gecos = buffer; + buffer += pw_gecos; + + strncpy(buffer, res->pw_dir, pw_dir); + pwd->pw_dir = buffer; + buffer += pw_dir; + + strncpy(buffer, res->pw_shell, pw_shell); + pwd->pw_shell = buffer; + buffer += pw_shell; + + *result = pwd ; + res = 0 ; + + } else { + + res = ENOMEM ; + + } + + } else { + + res = errno ; + + } + + pthread_mutex_unlock(&getrtl_mutex); + + return res; +} + struct tm *localtime_r(const time_t *timep, struct tm *buffer) { struct tm* res; -@@ -518,3 +585,50 @@ +@@ -712,3 +780,50 @@ } #endif +#if defined(NETBSD) || defined(FREEBSD) +char *fcvt(double value, int ndigit, int *decpt, int *sign) +{ + static char ret[256]; + char buf[256],zahl[256],format[256]="%"; + char *v1,*v2; + + if (value==0.0) value=1e-30; + + if (value<0.0) *sign=1; else *sign=0; + + if (value<1.0) + { + *decpt=(int)log10(value); + value*=pow(10.0,1-*decpt); + ndigit+=*decpt-1; + if (ndigit<0) ndigit=0; + } + else + { + *decpt=(int)log10(value)+1; + } + + sprintf(zahl,"%d",ndigit); + strcat(format,zahl); + strcat(format,"."); + strcat(format,zahl); + strcat(format,"f"); + + sprintf(buf,format,value); + + if (ndigit!=0) + { + v1=strtok(buf,"."); + v2=strtok(NULL,"."); + strcpy(ret,v1); + strcat(ret,v2); + } + else + { + strcpy(ret,buf); + } + + return(ret); +} + +#endif Property changes on: head/editors/openoffice/files/patch-sal+osl+unx+system.c ___________________________________________________________________ Modified: cvs2svn:cvs-rev ## -1 +1 ## -1.2 \ No newline at end of property +1.3 \ No newline at end of property Index: head/editors/openoffice/files/patch-sal+osl+unx+system.h =================================================================== --- head/editors/openoffice/files/patch-sal+osl+unx+system.h (revision 79373) +++ head/editors/openoffice/files/patch-sal+osl+unx+system.h (revision 79374) @@ -1,35 +1,53 @@ ---- ../sal/osl/unx/system.h.orig Wed Jun 5 16:24:19 2002 -+++ ../sal/osl/unx/system.h Sun Jan 12 15:48:03 2003 -@@ -205,6 +205,13 @@ +--- ../sal/osl/unx/system.h.orig Tue Aug 20 08:54:55 2002 ++++ ../sal/osl/unx/system.h Sat Apr 19 22:09:15 2003 +@@ -203,8 +203,16 @@ + # include + # include # include ++# include # include # include +# include +# include +# include +# include +# include +# include +# include # include # include # define IORESOURCE_TRANSFER_BSD -@@ -216,12 +223,13 @@ +@@ -216,12 +224,13 @@ # elif BYTE_ORDER == PDP_ENDIAN # define _PDP_ENDIAN # endif -# define sched_yield() pthread_yield() -# define pthread_testcancel() # define NO_PTHREAD_RTL -# define NO_PTHREAD_PRIORITY -# define CMD_ARG_PRG __progname -# define CMD_ARG_ENV environ +/* __progname isn't sufficient here. We need the full path as well + * for e.g. setup and __progname only points to the binary name. + */ +# define CMD_ARG_PRG_IS_DEFINED +# define CMD_ARG_PRG *((struct ps_strings *)PS_STRINGS)->ps_argvstr +# define CMD_ARG_ENV environ #endif #ifdef SCO +@@ -569,12 +578,14 @@ + #endif + + #ifdef NO_PTHREAD_RTL ++#if !defined FREEBSD || (__FreeBSD_version < 500112) + struct passwd *getpwent_r(struct passwd *pwd, char *buffer, int buflen); + extern struct spwd *getspnam_r(const char *name, struct spwd *result, + char *buffer, int buflen); + + struct tm *localtime_r(const time_t *timep, struct tm *buffer); + struct tm *gmtime_r(const time_t *timep, struct tm *buffer); ++#endif /* !defined FREEBSD || (__FreeBSD_version < 500112) */ + struct hostent *gethostbyname_r(const char *name, struct hostent *result, + char *buffer, int buflen, int *h_errnop); + #endif Property changes on: head/editors/openoffice/files/patch-sal+osl+unx+system.h ___________________________________________________________________ Modified: cvs2svn:cvs-rev ## -1 +1 ## -1.3 \ No newline at end of property +1.4 \ No newline at end of property Index: head/editors/openoffice-1.0/files/patch-sal+osl+unx+system.c =================================================================== --- head/editors/openoffice-1.0/files/patch-sal+osl+unx+system.c (revision 79373) +++ head/editors/openoffice-1.0/files/patch-sal+osl+unx+system.c (revision 79374) @@ -1,127 +1,137 @@ ---- ../sal/osl/unx/system.c.orig Sun Mar 17 12:34:13 2002 -+++ ../sal/osl/unx/system.c Wed Apr 3 01:03:36 2002 -@@ -195,6 +195,73 @@ +--- ../sal/osl/unx/system.c.orig Tue Aug 20 08:49:46 2002 ++++ ../sal/osl/unx/system.c Sat Apr 19 22:15:25 2003 +@@ -74,7 +74,8 @@ + static pthread_mutex_t getrtl_mutex = PTHREAD_MUTEX_INITIALIZER; + + /* struct passwd differs on some platforms */ +-#if defined NETBSD || defined MACOSX || defined FREEBSD ++#if defined NETBSD || defined MACOSX || \ ++ (defined FREEBSD && (__FreeBSD_version < 500112)) + #include + #include + +@@ -203,6 +204,73 @@ } #endif +int getpwuid_r(uid_t uid, struct passwd *pwd, char *buffer, + size_t buflen, struct passwd **result) +{ + struct passwd* res; + + pthread_mutex_lock(&getrtl_mutex); + + if ( res = getpwuid(uid) ) + { + size_t pw_name, pw_passwd, pw_class, pw_gecos, pw_dir, pw_shell; + + pw_name = strlen(res->pw_name)+1; + pw_passwd = strlen(res->pw_passwd)+1; + pw_class = strlen(res->pw_class)+1; + pw_gecos = strlen(res->pw_gecos)+1; + pw_dir = strlen(res->pw_dir)+1; + pw_shell = strlen(res->pw_shell)+1; + + if (pw_name+pw_passwd+pw_class+pw_gecos + +pw_dir+pw_shell < buflen) + { + memcpy(pwd, res, sizeof(struct passwd)); + + strncpy(buffer, res->pw_name, pw_name); + pwd->pw_name = buffer; + buffer += pw_name; + + strncpy(buffer, res->pw_passwd, pw_passwd); + pwd->pw_passwd = buffer; + buffer += pw_passwd; + + strncpy(buffer, res->pw_class, pw_class); + pwd->pw_class = buffer; + buffer += pw_class; + + strncpy(buffer, res->pw_gecos, pw_gecos); + pwd->pw_gecos = buffer; + buffer += pw_gecos; + + strncpy(buffer, res->pw_dir, pw_dir); + pwd->pw_dir = buffer; + buffer += pw_dir; + + strncpy(buffer, res->pw_shell, pw_shell); + pwd->pw_shell = buffer; + buffer += pw_shell; + + *result = pwd ; + res = 0 ; + + } else { + + res = ENOMEM ; + + } + + } else { + + res = errno ; + + } + + pthread_mutex_unlock(&getrtl_mutex); + + return res; +} + struct tm *localtime_r(const time_t *timep, struct tm *buffer) { struct tm* res; -@@ -518,3 +585,50 @@ +@@ -712,3 +780,50 @@ } #endif +#if defined(NETBSD) || defined(FREEBSD) +char *fcvt(double value, int ndigit, int *decpt, int *sign) +{ + static char ret[256]; + char buf[256],zahl[256],format[256]="%"; + char *v1,*v2; + + if (value==0.0) value=1e-30; + + if (value<0.0) *sign=1; else *sign=0; + + if (value<1.0) + { + *decpt=(int)log10(value); + value*=pow(10.0,1-*decpt); + ndigit+=*decpt-1; + if (ndigit<0) ndigit=0; + } + else + { + *decpt=(int)log10(value)+1; + } + + sprintf(zahl,"%d",ndigit); + strcat(format,zahl); + strcat(format,"."); + strcat(format,zahl); + strcat(format,"f"); + + sprintf(buf,format,value); + + if (ndigit!=0) + { + v1=strtok(buf,"."); + v2=strtok(NULL,"."); + strcpy(ret,v1); + strcat(ret,v2); + } + else + { + strcpy(ret,buf); + } + + return(ret); +} + +#endif Property changes on: head/editors/openoffice-1.0/files/patch-sal+osl+unx+system.c ___________________________________________________________________ Modified: cvs2svn:cvs-rev ## -1 +1 ## -1.2 \ No newline at end of property +1.3 \ No newline at end of property Index: head/editors/openoffice-1.0/files/patch-sal+osl+unx+system.h =================================================================== --- head/editors/openoffice-1.0/files/patch-sal+osl+unx+system.h (revision 79373) +++ head/editors/openoffice-1.0/files/patch-sal+osl+unx+system.h (revision 79374) @@ -1,35 +1,53 @@ ---- ../sal/osl/unx/system.h.orig Wed Jun 5 16:24:19 2002 -+++ ../sal/osl/unx/system.h Sun Jan 12 15:48:03 2003 -@@ -205,6 +205,13 @@ +--- ../sal/osl/unx/system.h.orig Tue Aug 20 08:54:55 2002 ++++ ../sal/osl/unx/system.h Sat Apr 19 22:09:15 2003 +@@ -203,8 +203,16 @@ + # include + # include # include ++# include # include # include +# include +# include +# include +# include +# include +# include +# include # include # include # define IORESOURCE_TRANSFER_BSD -@@ -216,12 +223,13 @@ +@@ -216,12 +224,13 @@ # elif BYTE_ORDER == PDP_ENDIAN # define _PDP_ENDIAN # endif -# define sched_yield() pthread_yield() -# define pthread_testcancel() # define NO_PTHREAD_RTL -# define NO_PTHREAD_PRIORITY -# define CMD_ARG_PRG __progname -# define CMD_ARG_ENV environ +/* __progname isn't sufficient here. We need the full path as well + * for e.g. setup and __progname only points to the binary name. + */ +# define CMD_ARG_PRG_IS_DEFINED +# define CMD_ARG_PRG *((struct ps_strings *)PS_STRINGS)->ps_argvstr +# define CMD_ARG_ENV environ #endif #ifdef SCO +@@ -569,12 +578,14 @@ + #endif + + #ifdef NO_PTHREAD_RTL ++#if !defined FREEBSD || (__FreeBSD_version < 500112) + struct passwd *getpwent_r(struct passwd *pwd, char *buffer, int buflen); + extern struct spwd *getspnam_r(const char *name, struct spwd *result, + char *buffer, int buflen); + + struct tm *localtime_r(const time_t *timep, struct tm *buffer); + struct tm *gmtime_r(const time_t *timep, struct tm *buffer); ++#endif /* !defined FREEBSD || (__FreeBSD_version < 500112) */ + struct hostent *gethostbyname_r(const char *name, struct hostent *result, + char *buffer, int buflen, int *h_errnop); + #endif Property changes on: head/editors/openoffice-1.0/files/patch-sal+osl+unx+system.h ___________________________________________________________________ Modified: cvs2svn:cvs-rev ## -1 +1 ## -1.3 \ No newline at end of property +1.4 \ No newline at end of property Index: head/editors/openoffice.org-1.0/files/patch-sal+osl+unx+system.c =================================================================== --- head/editors/openoffice.org-1.0/files/patch-sal+osl+unx+system.c (revision 79373) +++ head/editors/openoffice.org-1.0/files/patch-sal+osl+unx+system.c (revision 79374) @@ -1,127 +1,137 @@ ---- ../sal/osl/unx/system.c.orig Sun Mar 17 12:34:13 2002 -+++ ../sal/osl/unx/system.c Wed Apr 3 01:03:36 2002 -@@ -195,6 +195,73 @@ +--- ../sal/osl/unx/system.c.orig Tue Aug 20 08:49:46 2002 ++++ ../sal/osl/unx/system.c Sat Apr 19 22:15:25 2003 +@@ -74,7 +74,8 @@ + static pthread_mutex_t getrtl_mutex = PTHREAD_MUTEX_INITIALIZER; + + /* struct passwd differs on some platforms */ +-#if defined NETBSD || defined MACOSX || defined FREEBSD ++#if defined NETBSD || defined MACOSX || \ ++ (defined FREEBSD && (__FreeBSD_version < 500112)) + #include + #include + +@@ -203,6 +204,73 @@ } #endif +int getpwuid_r(uid_t uid, struct passwd *pwd, char *buffer, + size_t buflen, struct passwd **result) +{ + struct passwd* res; + + pthread_mutex_lock(&getrtl_mutex); + + if ( res = getpwuid(uid) ) + { + size_t pw_name, pw_passwd, pw_class, pw_gecos, pw_dir, pw_shell; + + pw_name = strlen(res->pw_name)+1; + pw_passwd = strlen(res->pw_passwd)+1; + pw_class = strlen(res->pw_class)+1; + pw_gecos = strlen(res->pw_gecos)+1; + pw_dir = strlen(res->pw_dir)+1; + pw_shell = strlen(res->pw_shell)+1; + + if (pw_name+pw_passwd+pw_class+pw_gecos + +pw_dir+pw_shell < buflen) + { + memcpy(pwd, res, sizeof(struct passwd)); + + strncpy(buffer, res->pw_name, pw_name); + pwd->pw_name = buffer; + buffer += pw_name; + + strncpy(buffer, res->pw_passwd, pw_passwd); + pwd->pw_passwd = buffer; + buffer += pw_passwd; + + strncpy(buffer, res->pw_class, pw_class); + pwd->pw_class = buffer; + buffer += pw_class; + + strncpy(buffer, res->pw_gecos, pw_gecos); + pwd->pw_gecos = buffer; + buffer += pw_gecos; + + strncpy(buffer, res->pw_dir, pw_dir); + pwd->pw_dir = buffer; + buffer += pw_dir; + + strncpy(buffer, res->pw_shell, pw_shell); + pwd->pw_shell = buffer; + buffer += pw_shell; + + *result = pwd ; + res = 0 ; + + } else { + + res = ENOMEM ; + + } + + } else { + + res = errno ; + + } + + pthread_mutex_unlock(&getrtl_mutex); + + return res; +} + struct tm *localtime_r(const time_t *timep, struct tm *buffer) { struct tm* res; -@@ -518,3 +585,50 @@ +@@ -712,3 +780,50 @@ } #endif +#if defined(NETBSD) || defined(FREEBSD) +char *fcvt(double value, int ndigit, int *decpt, int *sign) +{ + static char ret[256]; + char buf[256],zahl[256],format[256]="%"; + char *v1,*v2; + + if (value==0.0) value=1e-30; + + if (value<0.0) *sign=1; else *sign=0; + + if (value<1.0) + { + *decpt=(int)log10(value); + value*=pow(10.0,1-*decpt); + ndigit+=*decpt-1; + if (ndigit<0) ndigit=0; + } + else + { + *decpt=(int)log10(value)+1; + } + + sprintf(zahl,"%d",ndigit); + strcat(format,zahl); + strcat(format,"."); + strcat(format,zahl); + strcat(format,"f"); + + sprintf(buf,format,value); + + if (ndigit!=0) + { + v1=strtok(buf,"."); + v2=strtok(NULL,"."); + strcpy(ret,v1); + strcat(ret,v2); + } + else + { + strcpy(ret,buf); + } + + return(ret); +} + +#endif Property changes on: head/editors/openoffice.org-1.0/files/patch-sal+osl+unx+system.c ___________________________________________________________________ Modified: cvs2svn:cvs-rev ## -1 +1 ## -1.2 \ No newline at end of property +1.3 \ No newline at end of property Index: head/editors/openoffice.org-1.0/files/patch-sal+osl+unx+system.h =================================================================== --- head/editors/openoffice.org-1.0/files/patch-sal+osl+unx+system.h (revision 79373) +++ head/editors/openoffice.org-1.0/files/patch-sal+osl+unx+system.h (revision 79374) @@ -1,35 +1,53 @@ ---- ../sal/osl/unx/system.h.orig Wed Jun 5 16:24:19 2002 -+++ ../sal/osl/unx/system.h Sun Jan 12 15:48:03 2003 -@@ -205,6 +205,13 @@ +--- ../sal/osl/unx/system.h.orig Tue Aug 20 08:54:55 2002 ++++ ../sal/osl/unx/system.h Sat Apr 19 22:09:15 2003 +@@ -203,8 +203,16 @@ + # include + # include # include ++# include # include # include +# include +# include +# include +# include +# include +# include +# include # include # include # define IORESOURCE_TRANSFER_BSD -@@ -216,12 +223,13 @@ +@@ -216,12 +224,13 @@ # elif BYTE_ORDER == PDP_ENDIAN # define _PDP_ENDIAN # endif -# define sched_yield() pthread_yield() -# define pthread_testcancel() # define NO_PTHREAD_RTL -# define NO_PTHREAD_PRIORITY -# define CMD_ARG_PRG __progname -# define CMD_ARG_ENV environ +/* __progname isn't sufficient here. We need the full path as well + * for e.g. setup and __progname only points to the binary name. + */ +# define CMD_ARG_PRG_IS_DEFINED +# define CMD_ARG_PRG *((struct ps_strings *)PS_STRINGS)->ps_argvstr +# define CMD_ARG_ENV environ #endif #ifdef SCO +@@ -569,12 +578,14 @@ + #endif + + #ifdef NO_PTHREAD_RTL ++#if !defined FREEBSD || (__FreeBSD_version < 500112) + struct passwd *getpwent_r(struct passwd *pwd, char *buffer, int buflen); + extern struct spwd *getspnam_r(const char *name, struct spwd *result, + char *buffer, int buflen); + + struct tm *localtime_r(const time_t *timep, struct tm *buffer); + struct tm *gmtime_r(const time_t *timep, struct tm *buffer); ++#endif /* !defined FREEBSD || (__FreeBSD_version < 500112) */ + struct hostent *gethostbyname_r(const char *name, struct hostent *result, + char *buffer, int buflen, int *h_errnop); + #endif Property changes on: head/editors/openoffice.org-1.0/files/patch-sal+osl+unx+system.h ___________________________________________________________________ Modified: cvs2svn:cvs-rev ## -1 +1 ## -1.3 \ No newline at end of property +1.4 \ No newline at end of property