freebsd-dev/sbin/camcontrol
Dimitry Andric db58456d4c In sbin/camcontrol/camcontrol.c, function smpcmd(), initialize the
'error' variable to zero, to avoid returning garbage in several cases.

This fixes the following clang 3.2 warnings:

  sbin/camcontrol/camcontrol.c:4634:8: warning: variable 'error' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
                          if (amt_written == -1) {
                              ^~~~~~~~~~~~~~~~~
  sbin/camcontrol/camcontrol.c:4656:10: note: uninitialized use occurs here
          return (error);
                  ^~~~~

  sbin/camcontrol/camcontrol.c:4619:7: warning: variable 'error' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
                  if (fd_response == 0) {
                      ^~~~~~~~~~~~~~~~
  sbin/camcontrol/camcontrol.c:4656:10: note: uninitialized use occurs here
          return (error);
                  ^~~~~

  sbin/camcontrol/camcontrol.c:4617:6: warning: variable 'error' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
          if (((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP)
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  sbin/camcontrol/camcontrol.c:4656:10: note: uninitialized use occurs here
          return (error);
                  ^~~~~

MFC after:	1 week
2012-08-05 12:16:11 +00:00
..
camcontrol.8 Change 'camcontrol defects' to first probe a drive to find out how much 2012-06-22 18:57:06 +00:00
camcontrol.c In sbin/camcontrol/camcontrol.c, function smpcmd(), initialize the 2012-08-05 12:16:11 +00:00
camcontrol.h Update the 'fwdownload' command to also flash disks connected over an 2012-06-20 00:17:29 +00:00
fwdownload.c Update the 'fwdownload' command to also flash disks connected over an 2012-06-20 00:17:29 +00:00
Makefile Update the 'fwdownload' command to also flash disks connected over an 2012-06-20 00:17:29 +00:00
modeedit.c Fix warning when compiling with gcc46: 2012-01-10 02:59:58 +00:00
progress.c Add progress.c and progress.h, missed in the previous commit to camcontrol. 2012-06-20 04:11:34 +00:00
progress.h Add progress.c and progress.h, missed in the previous commit to camcontrol. 2012-06-20 04:11:34 +00:00
util.c Fix build. 2011-11-25 07:11:02 +00:00