freeipmi-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Freeipmi-devel] Re: [Freeipmi-users] SOLARIS PORTING Patches to merge i


From: Jan Forch
Subject: [Freeipmi-devel] Re: [Freeipmi-users] SOLARIS PORTING Patches to merge into new FreeIPMI release
Date: Tue, 10 Mar 2009 09:25:15 +0100
User-agent: Thunderbird 2.0.0.16 (X11/20080807)

Hi Al,
thanks for prompt feedback, changes seems OK.
   Jan Forch, Sun Microsystems

On 03/09/09 22:02, Al Chu wrote:
Hey Jan,

Applied the slightly modified attached patch.

Al

On Mon, 2009-03-09 at 17:48 +0100, Jan Forch wrote:
  
Hi experts,
I am sending patches which had to be applied on unzipped 
freeipmi-0.7.4.tar.gz source files else
FreeIPMI doesn't work properly on Solaris. I attached some comments 
(##### blocks) to them to
understand purpose of changes easily. Feel free to send me a feedback. 
In case someone is aware
of some other places in the source files where similar bug is presented 
please share it!
Thanks, have a nice day ;-)
   Jan Forch, Sun Microsystems

-----------------------------------------------------------------------------------------------------
| List of patche files aplied on unzipped freeipmi-0.7.4.tar.gz source 
files.
-----------------------------------------------------------------------------------------------------
 > ls
freeipmi2.patch  freeipmi.patch

PATCHES:
####################################################################################
# 1) freeipmi.patch
# The problem is that the behavior of the function getpwuid_r (...)  is 
different on Solaris and Linux.
# On Linux function returns 0 in case that everything is OK and not 0 
value as an error number.
# But on Solaris returns NULL in case of error and pointer if it was 
successful.
# So != had to be changed to ==.
####################################################################################
 > cat freeipmi.patch
diff -ru 
../freeipmi-0.7.4_orig/common/src/toolcommon/tool-sdr-cache-common.c 
./common/src/toolcommon/tool-sdr-cache-common.c
--- 
../freeipmi-0.7.4_orig/common/src/toolcommon/tool-sdr-cache-common.c        
Tue Jan  6 07:09:05 2009
+++ ./common/src/toolcommon/tool-sdr-cache-common.c     Thu Jan  8 
02:04:15 2009
@@ -229,8 +229,9 @@
   if (getpwuid_r (user_id,
                   &pwd,
                   tbuf,
-                  tbuf_len) != 0)
+                  tbuf_len) == NULL)
     {
+      /* User not found or another error */
       PSTDOUT_PERROR(pstate, "getpwuid_r");
       return -1;
     }


####################################################################################
# 1) freeipmi2.patch
# Almost same as the first one. But changes had to be made in two places 
in the source file.
####################################################################################
 > cat freeipmi2.patch
diff -ru ../freeipmi-0.7.4_orig/libfreeipmi/src/api/ipmi-api.c 
./libfreeipmi/src/api/ipmi-api.c
--- ../freeipmi-0.7.4_orig/libfreeipmi/src/api/ipmi-api.c       Tue Jan  
6 07:09:04 2009
+++ ./libfreeipmi/src/api/ipmi-api.c    Mon Jan 12 09:34:54 2009
@@ -274,11 +274,11 @@
                                                     &h_errnop));
   API_ERR_HOSTNAME_INVALID_CLEANUP(hptr);
 #elif defined(HAVE_FUNC_GETHOSTBYNAME_R_5)
-  API_ERR_HOSTNAME_INVALID_CLEANUP(!gethostbyname_r(hostname,
+  API_ERR_HOSTNAME_INVALID_CLEANUP(gethostbyname_r(hostname,
                                                     &hent,
                                                     buf,
                                                     
GETHOSTBYNAME_AUX_BUFLEN,
-                                                    &h_errnop));
+                                                    &h_errnop) != NULL);
 #else  /* !HAVE_FUNC_GETHOSTBYNAME_R */
   API_ERR_HOSTNAME_INVALID_CLEANUP(!freeipmi_gethostbyname_r(hostname,
                                                              &hent,
@@ -419,11 +419,11 @@
                                                     &h_errnop));
   API_ERR_HOSTNAME_INVALID_CLEANUP(hptr);
 #elif defined(HAVE_FUNC_GETHOSTBYNAME_R_5)
-  API_ERR_HOSTNAME_INVALID_CLEANUP(!gethostbyname_r(hostname,
+  API_ERR_HOSTNAME_INVALID_CLEANUP(gethostbyname_r(hostname,
                                                     &hent,
                                                     buf,
                                                     
GETHOSTBYNAME_AUX_BUFLEN,
-                                                    &h_errnop));
+                                                    &h_errnop) != NULL);
 #else  /* !HAVE_FUNC_GETHOSTBYNAME_R */
   API_ERR_HOSTNAME_INVALID_CLEANUP(!freeipmi_gethostbyname_r(hostname,
                                                              &hent,
_______________________________________________
Freeipmi-users mailing list
address@hidden
http:// lists.gnu.org/mailman/listinfo/freeipmi-users

    

_______________________________________________ Freeipmi-users mailing list address@hidden http://lists.gnu.org/mailman/listinfo/freeipmi-users


reply via email to

[Prev in Thread] Current Thread [Next in Thread]