Hey Jan,

Doh!  Sorry I missed these when I did the original Solaris port.  I
guess I just didn't notice them.  I'll make sure it's there for the next
FreeIPMI release.

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
> freeipmi-us...@gnu.org
> http:// lists.gnu.org/mailman/listinfo/freeipmi-users
> 
-- 
Albert Chu
ch...@llnl.gov
Computer Scientist
High Performance Systems Division
Lawrence Livermore National Laboratory



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

Reply via email to