coly wrote:
> Corey:
>
> I found some compiling error when build OpenIPMI packages, this is a
> patch based on 2.0.8. Please review it, thank you!
>
> Coly
>   
> ------------------------------------------------------------------------
>
> --- cmdlang/ipmish.c
> +++ cmdlang/ipmish.c
> @@ -382,6 +382,7 @@
>  out_help(FILE *s, int indent, const char *name, const char *v)
>  {
>      int pos, endpos;
> +    int rv;
>      const char *endword;
>      const char *endspace;
>  
> @@ -405,7 +406,10 @@
>           fprintf(s, "\n%*s", indent+2, "");
>           pos = indent + 2;
>       }
> -     fwrite(v, 1, endword-v, s);
> +     if ((rv = fwrite(v, 1, endword-v, s)) < 0) {
> +         fprintf(stderr, "error writing help information, giving up\n");
> +         exit(1);
>   
I don't think we want to exit if a write of help information fails.  Can
you just return?  It's actually not that important to do this, anyway.
> +     }
>       pos += endword - v;
>       v = endword;
>      }
> --- libedit/vi.c
> +++ libedit/vi.c
> @@ -1000,6 +1000,7 @@
>       int fd;
>       pid_t pid;
>       int st;
> +     int ret;
>       char tempfile[] = "/tmp/histedit.XXXXXXXXXX";
>       char *cp;
>  
> @@ -1012,8 +1013,10 @@
>       if (fd < 0)
>               return CC_ERROR;
>       cp = el->el_line.buffer;
> -     write(fd, cp, el->el_line.lastchar - cp +0u);
> -     write(fd, "\n", 1);
> +     if((ret = write(fd, cp, el->el_line.lastchar - cp +0u)) < 0)
> +             return CC_ERROR;
> +     if((ret = write(fd, "\n", 1)) < 0)
> +             return CC_ERROR;
>   
This is probably not worth doing, really.  Does it solve a compiler warning?
>       pid = fork();
>       switch (pid) {
>       case -1:
> --- swig/OpenIPMI.i
> +++ swig/OpenIPMI.i
> @@ -1131,7 +1131,7 @@
>      ipmi_user_list_get_enabled_users(info, &enabled);
>      ipmi_user_list_get_fixed_users(info, &fixed);
>      swig_call_cb(cb, "mc_channel_got_users_cb", "%p%d%d%d%d%*o", &mc_ref, 
> err,
> -              max, enabled, fixed, count, info_ref);
> +              max, enabled, fixed, count, (unsigned int)info_ref);
>   
No, this is not correct.  These are not printf calls, though I have
tried to make them as close as possible.  This is one place where it
couldn't be close enough.
>      swig_free_ref_check(mc_ref, ipmi_mc_t);
>      for (i=0; i<count; i++)
>       swig_free_ref(info_ref[i]);
> @@ -2511,7 +2511,7 @@
>      int         rv = 0;
>  
>      conn_ref = swig_make_ref(conn, ipmi_sol_conn_t);
> -    swig_call_cb_rv('i', &rv, cb, "sol_data_received", "%p%*b",
> +    swig_call_cb_rv('i', &rv, cb, "sol_data_received", "%p%d%p",
>                   &conn_ref, count, buf);
>   
Again, this is incorrect, same comment as above.  It might be best to
remove the printf attribute from this function.
>      swig_free_ref_check(conn_ref, ipmi_sol_conn_t);
>      return rv;
>   


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Openipmi-developer mailing list
Openipmi-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openipmi-developer

Reply via email to