[PATCH 08/13] platform_name fix Handled git pipeline errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Haritha D <harithamma.d@xxxxxxx>

This PR has fixes to enable build on z/OS

Signed-off-by: Harithamma D <harithamma.d@xxxxxxx>
---
 convert.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/convert.c b/convert.c
index c8d30011458..9cd0c1382ac 100644
--- a/convert.c
+++ b/convert.c
@@ -1321,19 +1321,14 @@ static const char* get_platform(void) {
 		die(_("uname() failed with error '%s' (%d)\n"),
 			strerror(errno),
 			errno);
-
+#ifndef __MVS__
 	if(*uname_info.sysname != '\0')
 	{
 		int index=0;
 		result = (char *)malloc(strlen(uname_info.sysname)+1);
-		while(index <= strlen(uname_info.sysname))
-		{
-			*result = uname_info.sysname[index];
-			++result;
-			++index;
-		}
-		*result = '\0';
+		strncpy(result, uname_info.sysname, strlen(uname_info.sysname));
 	}
+#endif
 
 #ifdef __MVS__
 	if (!strcmp(uname_info.sysname, "OS/390"))
-- 
gitgitgadget





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux