File qclib.correctly.interpret.sthyi.check.patch of Package qclib-devel

diff -Naurp qclib-1.2.0-vanilla/query_capacity.c qclib-1.2.0/query_capacity.c
--- qclib-1.2.0-vanilla/query_capacity.c	2016-06-03 09:14:01.000000000 +0200
+++ qclib-1.2.0/query_capacity.c	2017-03-21 08:53:50.000000000 +0100
@@ -96,7 +96,7 @@ static int qc_debug_file_init(void) {
 			close(fd);
 			goto out_err;
 		}
-		qc_debug(NULL, "This is qclib v1.2.0, level a7ecaf7, date 2016-06-03 09:04:14 +0200\n");
+		qc_debug(NULL, "This is qclib v1.2.0, level e5679bb, date 2017-03-21 08:49:07 +0100\n");
 	}
 
 	return 0;
diff -Naurp qclib-1.2.0-vanilla/query_capacity_sthyi.c qclib-1.2.0/query_capacity_sthyi.c
--- qclib-1.2.0-vanilla/query_capacity_sthyi.c	2016-06-03 09:14:01.000000000 +0200
+++ qclib-1.2.0/query_capacity_sthyi.c	2017-03-21 08:53:50.000000000 +0100
@@ -65,10 +65,10 @@ static int qc_is_sthyi_available(void) {
 #endif
 }
 
-static int qc_sthyi(char *sthyi_buffer) {
+static int qc_sthyi(struct sthyi_priv *priv) {
 #if defined __s390x__ || __s390__
 	register unsigned long function_code asm("2") = 0;
-	register unsigned long buffer asm("4") = (unsigned long) sthyi_buffer;
+	register unsigned long buffer asm("4") = (unsigned long) priv->data;
 	register unsigned long return_code asm("5");
 	int cc = -1;
 
@@ -80,10 +80,11 @@ static int qc_sthyi(char *sthyi_buffer)
 		      : "memory", "cc");
 	if (cc == 0) {
 		/* buffer was updated */
+		priv->avail = STHYI_AVAILABLE;
 		return 1;
 	}
-	/* if cc==-1: exception. never mind, return 0 */
-	/* if cc==3: never mind, r carries return code */
+	if (cc == 3 && return_code == 4)
+		return 1;
 #endif
 
 	return 0;
@@ -496,12 +497,11 @@ static int qc_sthyi_open(struct qc_handl
 		}
 		qc_debug(hdl, "STHYI is available\n");
 		/* we assume we are not relocated at this spot, between STFLE and STHYI */
-		if (!qc_sthyi(priv->data)) {
+		if (!qc_sthyi(priv)) {
 			qc_debug(hdl, "Error: STHYI execution failed\n");
 			rc = -3;
 			goto out;
 		}
-		priv->avail = STHYI_AVAILABLE;
 	}
 	goto out;
 
openSUSE Build Service is sponsored by