Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sg_pt_solaris.c compile failure on Solaris #98

Open
johnmartin-oracle opened this issue Sep 8, 2023 · 1 comment
Open

sg_pt_solaris.c compile failure on Solaris #98

johnmartin-oracle opened this issue Sep 8, 2023 · 1 comment

Comments

@johnmartin-oracle
Copy link

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
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants