hreinecke / sg3_utils

Deprecated git-svn mirror for sg3_utils
http://sg.danny.cz/sg/sg3_utils.html
Other
155 stars 91 forks source link

sg_pt_solaris.c compile failure on Solaris #98

Open johnmartin-oracle opened 1 year ago

johnmartin-oracle commented 1 year ago

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 /

doug-gilbert commented 1 year ago

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