Skip to content

Commit

Permalink
Fixed broken build issues on solaris.
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobvar authored and isimluk committed Apr 14, 2014
1 parent cfdd1df commit b426229
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/OVAL/probes/probe/signal_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ void *probe_signal_handler(void *arg)
* cancelability), but at most 60 seconds per thread.
*/
for (; coll.cnt > 0; --coll.cnt) {
probe_worker_t *thr = coll.thr[coll.cnt - 1];
#if defined(HAVE_PTHREAD_TIMEDJOIN_NP) && defined(HAVE_CLOCK_GETTIME)
struct timespec j_tm;
probe_worker_t *thr = coll.thr[coll.cnt - 1];

if (clock_gettime(CLOCK_REALTIME, &j_tm) == -1) {
dE("clock_gettime(CLOCK_REALTIME): %d, %s.\n", errno, strerror(errno));
Expand Down
6 changes: 5 additions & 1 deletion src/OVAL/probes/unix/solaris/isainfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,12 @@ int read_sysinfo(probe_ctx *ctx) {
if (sysinfo(SI_ARCHITECTURE_K, result.kernel_isa, MAX_STR_RESULT) == -1) {
return err;
}

#if defined(__SVR4) && defined(__sun)
if ((sysinfo(SI_ARCHITECTURE_32, result.application_isa, MAX_STR_RESULT) == -1) &&
(sysinfo(SI_ARCHITECTURE_64, result.application_isa, MAX_STR_RESULT) == -1)) {
#else
if (sysinfo(SI_ARCHITECTURE_NATIVE, result.application_isa, MAX_STR_RESULT) == -1) {
#endif
return err;
}

Expand Down
8 changes: 8 additions & 0 deletions src/XCCDF/tailoring.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,11 @@ xmlNodePtr xccdf_tailoring_to_dom(struct xccdf_tailoring *tailoring, xmlDocPtr d
xmlNode *tailoring_node = xmlNewNode(ns_xccdf, BAD_CAST "Tailoring");

const char *xccdf_version = xccdf_version_info_get_version(version_info);
#ifdef __USE_GNU
if (strverscmp(xccdf_version, "1.1") >= 0 && strverscmp(xccdf_version, "1.2") < 0) {
#else
if (strcmp(xccdf_version, "1.1") >= 0 && strcmp(xccdf_version, "1.2") < 0) {
#endif
// XCCDF 1.1 does not support Tailoring!
// However we will allow Tailoring export if it is done to an external
// file. The namespace will be our custom xccdf-1.1-tailoring extension
Expand All @@ -250,7 +254,11 @@ xmlNodePtr xccdf_tailoring_to_dom(struct xccdf_tailoring *tailoring, xmlDocPtr d
BAD_CAST "cdf-11-tailoring"
);
}
#ifdef __USE_GNU
else if (strverscmp(xccdf_version, "1.1") < 0) {
#else
else if (strcmp(xccdf_version, "1.1") < 0) {
#endif
oscap_seterr(OSCAP_EFAMILY_XML, "XCCDF Tailoring isn't supported in XCCDF version '%s',"
"nor does openscap have a custom extension for this scenario. "
"XCCDF Tailoring requires XCCDF 1.1 and higher, 1.2 is recommended.");
Expand Down

0 comments on commit b426229

Please sign in to comment.