rpms/openhpi/devel openhpi-2.0.3-gcc4.patch,1.1,1.2

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Wed Mar 30 13:56:19 UTC 2005


Update of /cvs/dist/rpms/openhpi/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv11224

Modified Files:
	openhpi-2.0.3-gcc4.patch 
Log Message:
- fgets fixes


openhpi-2.0.3-gcc4.patch:
 hpi_shell/commands.c             |   47 +++++++++++++++++++--------------------
 hpi_ui_lib/service.c             |   10 ++++----
 hpi_ui_lib/show.c                |    8 +++---
 plugins/ipmi/t/ipmi_thres_test.c |    2 -
 plugins/sysfs/sysfs2hpi.c        |    4 +--
 5 files changed, 36 insertions(+), 35 deletions(-)

Index: openhpi-2.0.3-gcc4.patch
===================================================================
RCS file: /cvs/dist/rpms/openhpi/devel/openhpi-2.0.3-gcc4.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- openhpi-2.0.3-gcc4.patch	30 Mar 2005 13:42:30 -0000	1.1
+++ openhpi-2.0.3-gcc4.patch	30 Mar 2005 13:56:16 -0000	1.2
@@ -115,7 +115,25 @@
  	/* add resource */
  	if (0 != oh_add_resource(inst->rptcache, &(e->u.res_event.entry), NULL, 0)) {
 --- openhpi-2.0.3/hpi_shell/commands.c.gcc4	2005-03-30 15:37:19.000000000 +0200
-+++ openhpi-2.0.3/hpi_shell/commands.c	2005-03-30 15:37:56.000000000 +0200
++++ openhpi-2.0.3/hpi_shell/commands.c	2005-03-30 15:55:41.000000000 +0200
+@@ -79,7 +79,7 @@
+ 	while (isblank(*input_buf_ptr)) input_buf_ptr++;
+ 	if (strlen(input_buf_ptr) == 0) {
+ 		printf("%s", mes);
+-		fgets(input_buffer, READ_BUF_SIZE, stdin);
++		ret = fgets(input_buffer, READ_BUF_SIZE, stdin);
+ 		for (res = 0; res < READ_BUF_SIZE; res++)
+ 			if (input_buffer[res] == '\n') input_buffer[res] = 0;
+ 		input_buf_ptr = input_buffer;
+@@ -540,7 +540,7 @@
+ 		resid = (SaHpiResourceIdT)atoi(argv[1]);
+ 	};
+ 	printf("New tag: ");
+-	fgets(buf, SAHPI_MAX_TEXT_BUFFER_LENGTH, stdin);
++	res = fgets(buf, SAHPI_MAX_TEXT_BUFFER_LENGTH, stdin);
+ 	for (res = 0; res < SAHPI_MAX_TEXT_BUFFER_LENGTH; res++)
+ 		if (buf[res] == '\n') buf[res] = 0;
+ 	str = buf;
 @@ -552,7 +552,7 @@
  		printf("Invalid tag: %s\n", buf);
  		return(-1);
@@ -125,7 +143,165 @@
  	tbuf.DataType = SAHPI_TL_TYPE_TEXT;
  	tbuf.Language = SAHPI_LANG_ENGLISH;
  	tbuf.DataLength = i;
-@@ -1393,7 +1393,7 @@
+@@ -612,7 +612,7 @@
+ 	};
+ 	printf("New severity (crit, maj, min, inf, ok, debug, all): ");
+ 	memset(buf, 0, SEV_BUF_SIZE + 1);
+-	fgets(buf, SEV_BUF_SIZE, stdin);
++	res = fgets(buf, SEV_BUF_SIZE, stdin);
+ 	for (res = 0; res < SEV_BUF_SIZE; res++)
+ 		if (buf[res] == '\n') buf[res] = 0;
+ 	str = buf;
+@@ -790,7 +790,7 @@
+ 	SaHpiTimeT		newtime;
+ 	struct tm		new_tm_time;
+ 	char			buf[READ_BUF_SIZE];
+-	int			day_array[] =
++	int			res, day_array[] =
+ 					{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
+ 
+ 	if (argc < 2) {
+@@ -802,7 +802,7 @@
+ 	};
+ 	memset(&new_tm_time, 0, sizeof(struct tm));
+ 	printf("format: MM:DD:YYYY:hh:mm:ss ==> ");
+-	fgets(buf, READ_BUF_SIZE, stdin);
++	res = fgets(buf, READ_BUF_SIZE, stdin);
+ 	sscanf(buf, "%d:%d:%d:%d:%d:%d", &new_tm_time.tm_mon, &new_tm_time.tm_mday,
+ 		&new_tm_time.tm_year, &new_tm_time.tm_hour, &new_tm_time.tm_min,
+ 		&new_tm_time.tm_sec);
+@@ -918,7 +918,7 @@
+ 	if (senstbuff.LowCritical.IsSupported) {
+ 		printf("Lower Critical(%s) ==> ",
+ 			get_thres_value(&(senstbuff.LowCritical), tmp, 256));
+-		fgets(tmp, 256, stdin);
++		res = fgets(tmp, 256, stdin);
+ 		res = sscanf(tmp, "%f", &f);
+ 		if (res == 1) {
+ 			modify = 1;
+@@ -928,7 +928,7 @@
+ 	if (senstbuff.LowMajor.IsSupported) {
+ 		printf("Lower Major(%s) ==> ",
+ 			get_thres_value(&(senstbuff.LowMajor), tmp, 256));
+-		fgets(tmp, 256, stdin);
++		res = fgets(tmp, 256, stdin);
+ 		res = sscanf(tmp, "%f", &f);
+ 		if (res == 1) {
+ 			modify = 1;
+@@ -938,7 +938,7 @@
+ 	if (senstbuff.LowMinor.IsSupported) {
+ 		printf("Lower Minor(%s) ==> ",
+ 			get_thres_value(&(senstbuff.LowMinor), tmp, 256));
+-		fgets(tmp, 256, stdin);
++		res = fgets(tmp, 256, stdin);
+ 		res = sscanf(tmp, "%f", &f);
+ 		if (res == 1) {
+ 			modify = 1;
+@@ -948,7 +948,7 @@
+ 	if (senstbuff.UpCritical.IsSupported) {
+ 		printf("Upper Critical(%s) ==> ",
+ 			get_thres_value(&(senstbuff.UpCritical), tmp, 256));
+-		fgets(tmp, 256, stdin);
++		res = fgets(tmp, 256, stdin);
+ 		res = sscanf(tmp, "%f", &f);
+ 		if (res == 1) {
+ 			modify = 1;
+@@ -958,7 +958,7 @@
+ 	if (senstbuff.UpMajor.IsSupported) {
+ 		printf("Upper Major(%s) ==> ",
+ 			get_thres_value(&(senstbuff.UpMajor), tmp, 256));
+-		fgets(tmp, 256, stdin);
++		res = fgets(tmp, 256, stdin);
+ 		res = sscanf(tmp, "%f", &f);
+ 		if (res == 1) {
+ 			modify = 1;
+@@ -968,7 +968,7 @@
+ 	if (senstbuff.UpMinor.IsSupported) {
+ 		printf("Upper Minor(%s) ==> ",
+ 			get_thres_value(&(senstbuff.UpMinor), tmp, 256));
+-		fgets(tmp, 256, stdin);
++		res = fgets(tmp, 256, stdin);
+ 		res = sscanf(tmp, "%f", &f);
+ 		if (res == 1) {
+ 			modify = 1;
+@@ -979,7 +979,7 @@
+ 		printf("Positive Hysteresis(%s) ==> ",
+ 			get_thres_value(&(senstbuff.PosThdHysteresis),
+ 			tmp, 256));
+-		fgets(tmp, 256, stdin);
++		res = fgets(tmp, 256, stdin);
+ 		res = sscanf(tmp, "%f", &f);
+ 		if (res == 1) {
+ 			modify = 1;
+@@ -990,7 +990,7 @@
+ 		printf("Negative Threshold Hysteresis(%s) ==> ",
+ 			get_thres_value(&(senstbuff.NegThdHysteresis),
+ 			tmp, 256));
+-		fgets(tmp, 256, stdin);
++		res = fgets(tmp, 256, stdin);
+ 		res = sscanf(tmp, "%f", &f);
+ 		if (res == 1) {
+ 			modify = 1;
+@@ -1011,7 +1011,7 @@
+ 	print_thres_value(&(senstbuff.NegThdHysteresis),
+ 		"Negative Hysteresis:", NULL, 0, ui_print);
+ 	printf("Set new threshold (yes|no) : ");
+-	fgets(tmp, 256, stdin);
++	res = fgets(tmp, 256, stdin);
+ 	if (strncmp(tmp, "yes", 3) != 0) {
+ 		printf("No action.\n");
+ 		return(SA_OK);
+@@ -1151,20 +1151,20 @@
+ 			};
+ 			printf("Assert mask = 0x");
+ 			strcpy(buf, "0x");
+-			fgets(buf + 2, 254, stdin);
++			res = fgets(buf + 2, 254, stdin);
+ 			str = buf;
+ 			if (strlen(str) < 3) continue;
+ 			assert = strtol(str, (char **)NULL, 16);
+ 			printf("Deassert mask = 0x");
+ 			strcpy(buf, "0x");
+-			fgets(buf + 2, 254, stdin);
++			res = fgets(buf + 2, 254, stdin);
+ 			str = buf;
+ 			if (strlen(str) < 3) continue;
+ 			deassert = strtol(str, (char **)NULL, 16);
+ 			printf("Sensor:(%d/%d) %s masks: assert = 0x%4.4x   "
+ 				"deassert = 0x%4.4x  (yes/no)?", rptid, rdrnum, rep,
+ 				assert, deassert);
+-			fgets(buf, 256, stdin);
++			res = fgets(buf, 256, stdin);
+ 			if (strncmp(buf, "yes", 3) != 0) {
+ 				printf("No action.\n");
+ 				continue;
+@@ -1194,6 +1194,7 @@
+ 	SaHpiCtrlStateDigitalT	state_val = 0;
+ 	SaHpiCtrlStateT		state;
+ 	char			buf[256];
++	int			res;
+ 
+ 	rv = saHpiRdrGetByInstrumentId(sessionid, resourceid, SAHPI_CTRL_RDR, num, &rdr);
+ 	if (rv != SA_OK) {
+@@ -1206,7 +1207,7 @@
+ 		case SAHPI_CTRL_TYPE_DIGITAL:
+ 			digit = &(ctrl->TypeUnion.Digital);
+ 			printf("New state (on|off|pulseon|pulseoff): ");
+-			fgets(buf, 256, stdin);
++			res = fgets(buf, 256, stdin);
+ 			if (strncmp(buf, "on", 2) == 0) state_val = SAHPI_CTRL_STATE_ON;
+ 			if (strncmp(buf, "off", 3) == 0) state_val = SAHPI_CTRL_STATE_OFF;
+ 			if (strncmp(buf, "pulseon", 7) == 0)
+@@ -1382,7 +1383,7 @@
+ 	field.ReadOnly = SAHPI_FALSE;
+ 	printf("Field value: ");
+ 	memset(buf, 0, 256);
+-	fgets(buf, 255, stdin);
++	res = fgets(buf, 255, stdin);
+ 	i = strlen(buf);
+ 	if (i < 2) *buf = 0;
+ 	else buf[i - 1] = 0;
+@@ -1393,7 +1394,7 @@
  	field.Field.Language = SAHPI_LANG_ENGLISH;
  	field.Field.DataLength = i;
  	if (i > 0)
@@ -134,7 +310,16 @@
  	rv = saHpiIdrFieldAdd(sessionId, rptid, rdrnum, &field);
  	if (rv != SA_OK) {
  		printf("ERROR!!! saHpiIdrFieldAdd: %s\n", oh_lookup_error(rv));
-@@ -1465,7 +1465,7 @@
+@@ -1454,7 +1455,7 @@
+ 	};
+ 	printf("Field value: ");
+ 	memset(buf, 0, 256);
+-	fgets(buf, 255, stdin);
++	res = fgets(buf, 255, stdin);
+ 	i = strlen(buf);
+ 	if (i < 2) *buf = 0;
+ 	else buf[i - 1] = 0;
+@@ -1465,7 +1466,7 @@
  		field.Field.DataType = SAHPI_TL_TYPE_TEXT;
  		field.Field.Language = SAHPI_LANG_ENGLISH;
  		field.Field.DataLength = i;




More information about the fedora-cvs-commits mailing list