sg3_utils icon indicating copy to clipboard operation
sg3_utils copied to clipboard

sg_pt_solaris.c compile failure on Solaris

Open johnmartin-oracle opened this issue 1 year ago • 1 comments

lib/sg_pt_solaris.c fails to compile with:

libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -iquote ../include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -W -g -O2 -MT sg_pt_solaris.lo -MD -MP -MF .deps/sg_pt_solaris.Tpo -c sg_pt_solaris.c -fPIC -DPIC -o .libs/sg_pt_solaris.o sg_pt_solaris.c: In function ‘scsi_pt_open_flags’: sg_pt_solaris.c:74:17: error: ‘sg_warnings_strm’ undeclared (first use in this function); did you mean ‘sg_set_warnings_strm’? 74 | fprintf(sg_warnings_strm ? sg_warnings_strm : stderr, | ^~~~~~~~~~~~~~~~ | sg_set_warnings_strm sg_pt_solaris.c:74:17: note: each undeclared identifier is reported only once for each function it appears in sg_pt_solaris.c: In function ‘construct_scsi_pt_obj_with_fd’: sg_pt_solaris.c:111:17: error: ‘sg_warnings_strm’ undeclared (first use in this function); did you mean ‘sg_set_warnings_strm’? 111 | fprintf(sg_warnings_strm ? sg_warnings_strm : stderr, | ^~~~~~~~~~~~~~~~ | sg_set_warnings_strm sg_pt_solaris.c: In function ‘do_scsi_pt’: sg_pt_solaris.c:292:19: error: ‘sg_warnings_strm’ undeclared (first use in this function); did you mean ‘sg_set_warnings_strm’? 292 | FILE * ferr = sg_warnings_strm ? sg_warnings_strm : stderr; | ^~~~~~~~~~~~~~~~ | sg_set_warnings_strm

Fix:

diff --git a/lib/sg_pt_solaris.c b/lib/sg_pt_solaris.c index e6cfa575..fdcae707 100644 --- a/lib/sg_pt_solaris.c +++ b/lib/sg_pt_solaris.c @@ -32,6 +32,7 @@

#include "sg_pt.h" #include "sg_lib.h" +#include "sg_pr2serr.h"

#define DEF_TIMEOUT 60 /* 60 seconds */

johnmartin-oracle avatar Sep 08 '23 00:09 johnmartin-oracle

This was also reported in my account: https://github.com/doug-gilbert/sg3_utils/issues/40 and has been fixed there.

doug-gilbert avatar Sep 22 '23 17:09 doug-gilbert