[kde-solaris] patch for kresolver.cpp (HEAD tag)

Christopher Layne clayne at anodized.com
Mon Aug 30 00:09:22 CEST 2004


If you're building off of CVS, this may come in useful to you:

--
[clayne at build02-sol8-x86 ~]$ uname -ripsv
SunOS 5.8 Generic_108529-12 i386 i86pc

diff -U4  ~/src/kde/HEAD/kdelibs/kdecore/network/kresolver.cpp ~/compile/kde/HEAD/kdelibs/kdecore/network/kresolver.cpp
*** src/kde/HEAD/kdelibs/kdecore/network/kresolver.cpp	Sat Aug 21 15:35:22 2004
--- compile/kde/HEAD/kdelibs/kdecore/network/kresolver.cpp	Sun Aug 29 14:54:43 2004
***************
*** 628,634 ****
--- 628,638 ----
    do
      {
        buf = new char[buflen];
+ # ifndef USE_SOLARIS // Solaris uses a 4 argument getprotobynumber_r which returns struct *protoent or NULL
        if (getprotobynumber_r(protonum, &protobuf, buf, buflen, &pe) == ERANGE)
+ # else
+       if ((pe = getprotobynumber_r(protonum, &protobuf, buf, buflen)) && (errno == ERANGE))
+ # endif
  	{
  	  buflen += 1024;
  	  delete [] buf;
***************
*** 670,676 ****
--- 674,684 ----
    do
      {
        buf = new char[buflen];
+ # ifndef USE_SOLARIS // Solaris uses a 4 argument getprotobyname_r which returns struct *protoent or NULL
        if (getprotobyname_r(protoname, &protobuf, buf, buflen, &pe) == ERANGE)
+ # else
+       if ((pe = getprotobyname_r(protoname, &protobuf, buf, buflen)) && (errno == ERANGE))
+ # endif
  	{
  	  buflen += 1024;
  	  delete [] buf;
***************
*** 712,718 ****
--- 720,730 ----
    do
      {
        buf = new char[buflen];
+ # ifndef USE_SOLARIS // Solaris uses a 4 argument getprotobyname_r which returns struct *protoent or NULL
        if (getprotobyname_r(protoname, &protobuf, buf, buflen, &pe) == ERANGE)
+ # else
+       if ((pe = getprotobyname_r(protoname, &protobuf, buf, buflen)) && (errno == ERANGE))
+ # endif
  	{
  	  buflen += 1024;
  	  delete [] buf;
***************
*** 750,756 ****
--- 762,772 ----
    do
      {
        buf = new char[buflen];
+ # ifndef USE_SOLARIS // Solaris uses a 5 argument getservbyname_r which returns struct *servent or NULL
        if (getservbyname_r(servname, protoname, &servbuf, buf, buflen, &se) == ERANGE)
+ # else
+       if ((se = getservbyname_r(servname, protoname, &servbuf, buf, buflen)) && (errno == ERANGE))
+ # endif
  	{
  	  buflen += 1024;
  	  delete [] buf;
***************
*** 788,794 ****
--- 804,814 ----
    do
      {
        buf = new char[buflen];
+ # ifndef USE_SOLARIS // Solaris uses a 5 argument getservbyname_r which returns struct *servent or NULL
        if (getservbyname_r(servname, protoname, &servbuf, buf, buflen, &se) == ERANGE)
+ # else
+       if ((se = getservbyname_r(servname, protoname, &servbuf, buf, buflen)) && (errno == ERANGE))
+ # endif
  	{
  	  buflen += 1024;
  	  delete [] buf;
***************
*** 830,836 ****
--- 850,860 ----
    do
      {
        buf = new char[buflen];
+ # ifndef USE_SOLARIS // Solaris uses a 5 argument getservbyport_r which returns struct *servent or NULL
        if (getservbyport_r(port, protoname, &servbuf, buf, buflen, &se) == ERANGE)
+ # else
+       if ((se = getservbyport_r(port, protoname, &servbuf, buf, buflen)) && (errno == ERANGE))
+ # endif
  	{
  	  buflen += 1024;
  	  delete [] buf;


More information about the kde-solaris mailing list