From patchwork Mon Nov 13 10:24:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haritha D X-Patchwork-Id: 13453769 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 16778C8DE for ; Mon, 13 Nov 2023 10:24:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Wjp489Dg" Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE29A10CC for ; Mon, 13 Nov 2023 02:24:20 -0800 (PST) Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-4083ac51d8aso34463755e9.2 for ; Mon, 13 Nov 2023 02:24:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699871058; x=1700475858; darn=vger.kernel.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=0l4XmiTb69qn2BgH9BwECj63T+IbdY5zDETcIIYErL8=; b=Wjp489Dgr1zSD66q3snYCGxY9l5ZcgOpwoTdCH1NDPhqcIsVUr7OPDaC0ozNouXVah UHtYqjxmVSHPMHINWD2MRBVnHTY4rteqCalCaqJ6tVUf9O6yoj1N4BVgsshpOU06FUBj lzg3P1+BGvc/DeoZbzpS1XZNFK0CvrfmR5YzEG1sM8/eVlCDol44v9y8YdLMqstYvLzK faaXSnQx5qsRbcbEjBiwnB/VXjNRvYo3+3Ib/xKoRtlKWR1c7y9aSboSepyDrLepq6TZ 5Con0XAwJh2wp4DGKhWGcEZRP092yDyFEaU45gdScoKj/0n5Y25OJYewHAU2eRnSe8cF rgJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699871058; x=1700475858; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0l4XmiTb69qn2BgH9BwECj63T+IbdY5zDETcIIYErL8=; b=AQS4WBSSHBwbSXOgQ5Qe0Fjlvv0W8cG2eAvC54Thx3lt8QZzWGcZH88pEggi0n/Oba vsgIZ8vbbErRbKlsQbY9rRLh6z/8u4fr9Qwp/lDmOhLZhRXomeo5KYnvtxsemx+b2xJH V7Vmr6bs8Dd5wnGVrBKhZWefWy4M1QDXAjjSGEc4HYGwProGZrMbcHV9fCPjz2yaZ+u1 wxpQszRxEJUFoxTpSabHRbdEjAwWeD9+rkih1uhfeqzvUNkLPx8FWevx8n9cCUtEOfL4 7Th+pkRmm2UcuJQCaMCNSxA8k3UhOg/66Bwp4AorpMEKZKYJ4K0BLCXGJXP8QD3rEKKZ oLlA== X-Gm-Message-State: AOJu0YxUnf2/LApInREltj8dj7aYh11cS90Mt6nDtKx/D1gzf1ATnWFk VWi03Z2xOsVXozzBqs7JqKbEHziRHgg= X-Google-Smtp-Source: AGHT+IF50INO4lq2F05J0AtR3Y4ho3w6g9gBjxVNkDexDhRMyPMXUT2kpM3ndljgRAA1BoihrkHUBw== X-Received: by 2002:a05:600c:3548:b0:401:daf2:2737 with SMTP id i8-20020a05600c354800b00401daf22737mr4846716wmq.30.1699871058357; Mon, 13 Nov 2023 02:24:18 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id b12-20020a05600c150c00b004083a105f27sm13154609wmg.26.2023.11.13.02.24.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 02:24:18 -0800 (PST) Message-ID: <712eb3712f1efb6f98b28bfe1e7d4f4f1aaa0152.1699871056.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Mon, 13 Nov 2023 10:24:03 +0000 Subject: [PATCH 01/13] Enabling z/OS workflow for git Fcc: Sent Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 To: git@vger.kernel.org Cc: Haritha , Haritha D From: Haritha D From: Haritha D Our team ported Git to z/OS w/ significant modifcation. This patch is Initial Config Signed-off-by: Haritha D --- config.mak.uname | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/config.mak.uname b/config.mak.uname index 3bb03f423a0..6ba9b707006 100644 --- a/config.mak.uname +++ b/config.mak.uname @@ -625,6 +625,26 @@ ifeq ($(uname_S),NONSTOP_KERNEL) SANE_TOOL_PATH = /usr/coreutils/bin:/usr/local/bin SHELL_PATH = /usr/coreutils/bin/bash endif + +ifeq ($(uname_S),OS/390) + PERL_PATH = perl + PERL_PATH_FOR_SCRIPTS = /bin/env perl + SHELL_PATH = bash + SHELL_PATH_FOR_SCRIPTS = /bin/env bash + PYTHON_PATH = python + NO_SYS_POLL_H = YesPlease + NO_STRCASESTR = YesPlease + NO_REGEX = YesPlease + NO_MMAP = YesPlease + NO_NSEC = YesPlease + NO_STRLCPY = YesPlease + NO_MKDTEMP = YesPlease + NO_MEMMEM = YesPlease + NO_GECOS_IN_PWENT = YesPlease + HAVE_STRINGS_H = YesPlease + NEEDS_MODE_TRANSLATION = YesPlease +endif + ifeq ($(uname_S),MINGW) ifeq ($(shell expr "$(uname_R)" : '1\.'),2) $(error "Building with MSys is no longer supported") From patchwork Mon Nov 13 10:24:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haritha D X-Patchwork-Id: 13453777 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9B6EF1CAA9 for ; Mon, 13 Nov 2023 10:24:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SiLcX6ea" Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD6FC10CA for ; Mon, 13 Nov 2023 02:24:21 -0800 (PST) Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2c742186a3bso52498781fa.1 for ; Mon, 13 Nov 2023 02:24:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699871059; x=1700475859; darn=vger.kernel.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=RDNqIUNjpEC1Se9dOL9trQehzBK78wXBxZW8yb4070s=; b=SiLcX6ea29QPJ1g/VpO3UUnlXYe3VVMOtA2VjZrZygOVthJCIk9uMCd7AReOtolifv j8t8U2SV8Yzbs8/BslqU8womIzdcK4rT0dfTeuwtX7RjnpysHnzYkpGSuhlFVDDVyjzk ShFcMVrF2TDTVSORbRz7swNkxYzPqSdsXyht1Eb/IDYg+nGvfTAOXfPqwaYXO4UK6NH8 wi2sm0whgZa9h+Z57lqjsHJtgpUexVCWdHXCRVlMGYiB1RnkkKlZBYJ0zCYsgDQG4y4t I8kopNBi1iKNpPZi8hrazQ9dz6gzVi5NJIF+lqJp3aLkzedbAfACHuJcdqXxfIbxEfs4 8xtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699871059; x=1700475859; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RDNqIUNjpEC1Se9dOL9trQehzBK78wXBxZW8yb4070s=; b=j3KnDT0XpPr/0dowdYr75mw5qXsrLH4O2MDL+kRlIT20fzM+XeBhtg2qA9yn398OS6 kXnHm11LXjRMDvgD1EkZbRjbVBCPVJPelb+pSlZsRuZzW2FjWbNuuWOR1+1IeePBubLW d8GkKAGBAsFGg6U/GeGJ6vzGZfj1apMEyd/Mttj0QJ5JHKdeFgYGEeOb/CspLnEex5cE pyZwUXTwOsacjKZRYN9vglgsgu3e1TcaRu7qZIiPG9cnjb/2cxdO3saX1weF/bkM6POJ A6GLR2uHjgFH5TEZxLt5clGksJDsskoU+eQ//sMwj8BaeNYfyorx/V8na4pqnFxtjpTv FTmw== X-Gm-Message-State: AOJu0Yx/clV9osD+5GpcoOWNQqJhizI0P/HHSAqHrKl7QRG83mgPLsLW QkipYeDP1Ec/GiamCkuPGoPzP733Flw= X-Google-Smtp-Source: AGHT+IEzK/wkgIQsON1qG51e3eHI7TsK+CpFrIQoRMIHG8Z66BcvkI71Dwr945fTV7eaHXDD7l1BFg== X-Received: by 2002:a2e:7803:0:b0:2bc:c28c:a2b8 with SMTP id t3-20020a2e7803000000b002bcc28ca2b8mr3515705ljc.27.1699871058894; Mon, 13 Nov 2023 02:24:18 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id j10-20020a05600c300a00b0040773c69fc0sm13143450wmh.11.2023.11.13.02.24.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 02:24:18 -0800 (PST) Message-ID: <098b9ca8ece4fdce45a9b48e576b474ed81dced1.1699871056.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Mon, 13 Nov 2023 10:24:04 +0000 Subject: [PATCH 02/13] Enable builds for z/OS. Fcc: Sent Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 To: git@vger.kernel.org Cc: Haritha , Haritha D From: Haritha D From: Haritha D This commit enables git to build on z/OS. It takes advantage of enahanced ASCII services on z/OS to auto-convert input files to ASCII It also adds support for [platform]-working-tree-encoding. Platform is substituted with uname_info.sysname, so it will only apply to the given platform. Also adds support for scripts that are not in standard locations so that /bin/env bash can be specified. Signed-off-by: Harithamma D --- Makefile | 21 +++++++++--- builtin.h | 3 ++ builtin/archive.c | 6 ++++ builtin/hash-object.c | 28 +++++++++++++++ combine-diff.c | 4 +++ config.c | 7 ++++ configure.ac | 3 ++ convert.c | 44 ++++++++++++++++++++---- copy.c | 3 ++ diff.c | 11 ++++++ entry.c | 26 ++++++++++++++ environment.c | 3 ++ git-compat-util.h | 8 +++++ negotiator/default.c | 4 +-- negotiator/noop.c | 4 +-- negotiator/skipping.c | 4 +-- object-file.c | 80 ++++++++++++++++++++++++++++++++++++++++++- read-cache.c | 3 ++ utf8.c | 11 ++++++ 19 files changed, 255 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 9c6a2f125f8..30aa76da4f4 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,8 @@ include shared.mak # # Define SHELL_PATH to a POSIX shell if your /bin/sh is broken. # +# Define SHELL_PATH_FOR_SCRIPTS to a POSIX shell if your /bin/sh is broken. +# # Define SANE_TOOL_PATH to a colon-separated list of paths to prepend # to PATH if your tools in /usr/bin are broken. # @@ -215,6 +217,8 @@ include shared.mak # # Define PERL_PATH to the path of your Perl binary (usually /usr/bin/perl). # +# Define PERL_PATH_FOR_SCRIPTS to a Perl binary if your /usr/bin/perl is broken. +# # Define NO_PERL if you do not want Perl scripts or libraries at all. # # Define NO_PERL_CPAN_FALLBACKS if you do not want to install bundled @@ -903,9 +907,15 @@ BINDIR_PROGRAMS_NO_X += git-cvsserver ifndef SHELL_PATH SHELL_PATH = /bin/sh endif +ifndef SHELL_PATH_FOR_SCRIPTS + SHELL_PATH_FOR_SCRIPTS = /bin/sh +endif ifndef PERL_PATH PERL_PATH = /usr/bin/perl endif +ifndef PERL_PATH_FOR_SCRIPTS + PERL_PATH_FOR_SCRIPTS = /usr/bin/perl +endif ifndef PYTHON_PATH PYTHON_PATH = /usr/bin/python endif @@ -1336,7 +1346,7 @@ THIRD_PARTY_SOURCES += sha1dc/% # xdiff and reftable libs may in turn depend on what is in libgit.a GITLIBS = common-main.o $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB) $(LIB_FILE) -EXTLIBS = +EXTLIBS = $(ZOPEN_EXTRA_LIBS) GIT_USER_AGENT = git/$(GIT_VERSION) @@ -2226,9 +2236,10 @@ perllibdir_relative_SQ = $(subst ','\'',$(perllibdir_relative)) gitwebdir_SQ = $(subst ','\'',$(gitwebdir)) gitwebstaticdir_SQ = $(subst ','\'',$(gitwebstaticdir)) -SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH)) +SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH_FOR_SCRIPTS)) TEST_SHELL_PATH_SQ = $(subst ','\'',$(TEST_SHELL_PATH)) PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH)) +PERL_PATH_FOR_SCRIPTS_SQ = $(subst ','\'',$(PERL_PATH_FOR_SCRIPTS)) PYTHON_PATH_SQ = $(subst ','\'',$(PYTHON_PATH)) TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH)) DIFF_SQ = $(subst ','\'',$(DIFF)) @@ -2448,7 +2459,7 @@ hook-list.h: generate-hooklist.sh Documentation/githooks.txt SCRIPT_DEFINES = $(SHELL_PATH_SQ):$(DIFF_SQ):\ $(localedir_SQ):$(USE_GETTEXT_SCHEME):$(SANE_TOOL_PATH_SQ):\ - $(gitwebdir_SQ):$(PERL_PATH_SQ):$(PAGER_ENV):\ + $(gitwebdir_SQ):$(PERL_PATH_FOR_SCRIPTS_SQ):$(PAGER_ENV):\ $(perllibdir_SQ) GIT-SCRIPT-DEFINES: FORCE @FLAGS='$(SCRIPT_DEFINES)'; \ @@ -2465,7 +2476,7 @@ sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ -e 's/@@USE_GETTEXT_SCHEME@@/$(USE_GETTEXT_SCHEME)/g' \ -e $(BROKEN_PATH_FIX) \ -e 's|@@GITWEBDIR@@|$(gitwebdir_SQ)|g' \ - -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \ + -e 's|@@PERL@@|$(PERL_PATH_FOR_SCRIPTS_SQ)|g' \ -e 's|@@PAGER_ENV@@|$(PAGER_ENV_SQ)|g' \ $@.sh >$@+ endef @@ -2519,7 +2530,7 @@ PERL_DEFINES += $(gitexecdir) $(perllibdir) $(localedir) $(SCRIPT_PERL_GEN): % : %.perl GIT-PERL-DEFINES GIT-PERL-HEADER GIT-VERSION-FILE $(QUIET_GEN) \ sed -e '1{' \ - -e ' s|#!.*perl|#!$(PERL_PATH_SQ)|' \ + -e ' s|#!.*perl|#!$(PERL_PATH_FOR_SCRIPTS_SQ)|' \ -e ' r GIT-PERL-HEADER' \ -e ' G' \ -e '}' \ diff --git a/builtin.h b/builtin.h index d560baa6618..806af1a262d 100644 --- a/builtin.h +++ b/builtin.h @@ -250,5 +250,8 @@ int cmd_verify_pack(int argc, const char **argv, const char *prefix); int cmd_show_ref(int argc, const char **argv, const char *prefix); int cmd_pack_refs(int argc, const char **argv, const char *prefix); int cmd_replace(int argc, const char **argv, const char *prefix); +#ifdef __MVS__ + extern int setbinaryfd(int); +#endif #endif diff --git a/builtin/archive.c b/builtin/archive.c index 90761fdfee0..53ec794356f 100644 --- a/builtin/archive.c +++ b/builtin/archive.c @@ -14,6 +14,12 @@ static void create_output_file(const char *output_file) { int output_fd = xopen(output_file, O_CREAT | O_WRONLY | O_TRUNC, 0666); +#ifdef __MVS__ + #if (__CHARSET_LIB == 1) + if (setbinaryfd(output_fd)) + die_errno(_("could not tag archive file '%s'"), output_file); + #endif +#endif if (output_fd != 1) { if (dup2(output_fd, 1) < 0) die_errno(_("could not redirect output")); diff --git a/builtin/hash-object.c b/builtin/hash-object.c index 5ffec99dcea..b33b32ff977 100644 --- a/builtin/hash-object.c +++ b/builtin/hash-object.c @@ -57,11 +57,39 @@ static void hash_fd(int fd, const char *type, const char *path, unsigned flags, maybe_flush_or_die(stdout, "hash to stdout"); } +#ifdef __MVS__ +# if (__CHARSET_LIB == 1) +# include +# include + + int setbinaryfd(int fd) + { + attrib_t attr; + int rc; + + memset(&attr, 0, sizeof(attr)); + attr.att_filetagchg = 1; + attr.att_filetag.ft_ccsid = FT_BINARY; + attr.att_filetag.ft_txtflag = 0; + + rc = __fchattr(fd, &attr, sizeof(attr)); + return rc; + } +# endif +#endif + + static void hash_object(const char *path, const char *type, const char *vpath, unsigned flags, int literally) { int fd; fd = xopen(path, O_RDONLY); +#ifdef __MVS__ +# if (__CHARSET_LIB == 1) + if (setbinaryfd(fd)) + die_errno("Cannot set to binary '%s'", path); +# endif +#endif hash_fd(fd, type, vpath, flags, literally); } diff --git a/combine-diff.c b/combine-diff.c index f90f4424829..73445a517c7 100644 --- a/combine-diff.c +++ b/combine-diff.c @@ -1082,6 +1082,10 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent, ssize_t done; int is_file, i; +#ifdef __MVS__ + __disableautocvt(fd); +#endif + elem->mode = canon_mode(st.st_mode); /* if symlinks don't work, assume symlink if all parents * are symlinks diff --git a/config.c b/config.c index f9a1cca4e8a..37c124a37c0 100644 --- a/config.c +++ b/config.c @@ -1521,6 +1521,13 @@ static int git_default_core_config(const char *var, const char *value, return 0; } + #ifdef __MVS__ + if (!strcmp(var, "core.ignorefiletags")) { + ignore_file_tags = git_config_bool(var, value); + return 0; + } + #endif + if (!strcmp(var, "core.safecrlf")) { int eol_rndtrp_die; if (value && !strcasecmp(value, "warn")) { diff --git a/configure.ac b/configure.ac index 276593cd9dd..ed380504be6 100644 --- a/configure.ac +++ b/configure.ac @@ -463,6 +463,9 @@ else CC_LD_DYNPATH=-Wl,+b, else CC_LD_DYNPATH= + if test "$(uname -s)" = "OS/390"; then + CC_LD_DYNPATH=-L + fi AC_MSG_WARN([linker does not support runtime path to dynamic libraries]) fi fi diff --git a/convert.c b/convert.c index a8870baff36..4f14ff6f1ed 100644 --- a/convert.c +++ b/convert.c @@ -377,12 +377,15 @@ static int check_roundtrip(const char *enc_name) static const char *default_encoding = "UTF-8"; static int encode_to_git(const char *path, const char *src, size_t src_len, - struct strbuf *buf, const char *enc, int conv_flags) + struct strbuf *buf, const char *enc, enum convert_crlf_action attr_action, int conv_flags) { char *dst; size_t dst_len; int die_on_error = conv_flags & CONV_WRITE_OBJECT; + if (attr_action == CRLF_BINARY) { + return 0; + } /* * No encoding is specified or there is nothing to encode. * Tell the caller that the content was not modified. @@ -403,6 +406,11 @@ static int encode_to_git(const char *path, const char *src, size_t src_len, return 0; trace_encoding("source", path, enc, src, src_len); +#ifdef __MVS__ + // Don't convert ISO8859-1 on z/OS + if (strcasecmp("ISO8859-1", enc) == 0) + return 0; +#endif dst = reencode_string_len(src, src_len, default_encoding, enc, &dst_len); if (!dst) { @@ -468,11 +476,14 @@ static int encode_to_git(const char *path, const char *src, size_t src_len, } static int encode_to_worktree(const char *path, const char *src, size_t src_len, - struct strbuf *buf, const char *enc) + struct strbuf *buf, enum convert_crlf_action attr_action, const char *enc) { char *dst; size_t dst_len; + if (attr_action == CRLF_BINARY) { + return 0; + } /* * No encoding is specified or there is nothing to encode. * Tell the caller that the content was not modified. @@ -1302,18 +1313,37 @@ static int git_path_check_ident(struct attr_check_item *check) static struct attr_check *check; +static const char* get_platform() { + struct utsname uname_info; + + if (uname(&uname_info)) + die(_("uname() failed with error '%s' (%d)\n"), + strerror(errno), + errno); + + if (!strcmp(uname_info.sysname, "OS/390")) + return "zos"; + return uname_info.sysname; +} + + void convert_attrs(struct index_state *istate, struct conv_attrs *ca, const char *path) { struct attr_check_item *ccheck = NULL; + struct strbuf platform_working_tree_encoding = STRBUF_INIT; + + strbuf_addf(&platform_working_tree_encoding, "%s-working-tree-encoding", get_platform()); + if (!check) { check = attr_check_initl("crlf", "ident", "filter", - "eol", "text", "working-tree-encoding", + "eol", "text", "working-tree-encoding", platform_working_tree_encoding.buf, NULL); user_convert_tail = &user_convert; git_config(read_convert_config, NULL); } + strbuf_release(&platform_working_tree_encoding); git_check_attr(istate, path, check); ccheck = check->items; @@ -1334,6 +1364,8 @@ void convert_attrs(struct index_state *istate, ca->crlf_action = CRLF_TEXT_CRLF; } ca->working_tree_encoding = git_path_check_encoding(ccheck + 5); + if (git_path_check_encoding(ccheck + 6)) + ca->working_tree_encoding = git_path_check_encoding(ccheck + 6); /* Save attr and make a decision for action */ ca->attr_action = ca->crlf_action; @@ -1427,7 +1459,7 @@ int convert_to_git(struct index_state *istate, len = dst->len; } - ret |= encode_to_git(path, src, len, dst, ca.working_tree_encoding, conv_flags); + ret |= encode_to_git(path, src, len, dst, ca.working_tree_encoding, ca.attr_action, conv_flags); if (ret && dst) { src = dst->buf; len = dst->len; @@ -1455,7 +1487,7 @@ void convert_to_git_filter_fd(struct index_state *istate, if (!apply_filter(path, NULL, 0, fd, dst, ca.drv, CAP_CLEAN, NULL, NULL)) die(_("%s: clean filter '%s' failed"), path, ca.drv->name); - encode_to_git(path, dst->buf, dst->len, dst, ca.working_tree_encoding, conv_flags); + encode_to_git(path, dst->buf, dst->len, dst, ca.working_tree_encoding, ca.attr_action, conv_flags); crlf_to_git(istate, path, dst->buf, dst->len, dst, ca.crlf_action, conv_flags); ident_to_git(dst->buf, dst->len, dst, ca.ident); } @@ -1487,7 +1519,7 @@ static int convert_to_working_tree_ca_internal(const struct conv_attrs *ca, } } - ret |= encode_to_worktree(path, src, len, dst, ca->working_tree_encoding); + ret |= encode_to_worktree(path, src, len, dst, ca->attr_action, ca->working_tree_encoding); if (ret) { src = dst->buf; len = dst->len; diff --git a/copy.c b/copy.c index 23d84c6c1db..63546aecf81 100644 --- a/copy.c +++ b/copy.c @@ -14,6 +14,9 @@ int copy_fd(int ifd, int ofd) if (write_in_full(ofd, buffer, len) < 0) return COPY_WRITE_ERROR; } +#ifdef __MVS__ + __copyfdccsid(ifd, ofd); +#endif return 0; } diff --git a/diff.c b/diff.c index 2c602df10a3..28b96d53dbc 100644 --- a/diff.c +++ b/diff.c @@ -4083,6 +4083,9 @@ int diff_populate_filespec(struct repository *r, int check_binary = options ? options->check_binary : 0; int err = 0; int conv_flags = global_conv_flags_eol; +#ifdef __MVS__ + int autocvtToASCII; +#endif /* * demote FAIL to WARN to allow inspecting the situation * instead of refusing. @@ -4155,9 +4158,17 @@ int diff_populate_filespec(struct repository *r, s->is_binary = 1; return 0; } +#ifdef __MVS__ + validate_codeset(r->index, s->path, &autocvtToASCII); +#endif fd = open(s->path, O_RDONLY); if (fd < 0) goto err_empty; + +#ifdef __MVS__ + if (!autocvtToASCII) + __disableautocvt(fd); +#endif s->data = xmmap(NULL, s->size, PROT_READ, MAP_PRIVATE, fd, 0); close(fd); s->should_munmap = 1; diff --git a/entry.c b/entry.c index 076e97eb89c..df6feb2234b 100644 --- a/entry.c +++ b/entry.c @@ -126,6 +126,24 @@ int fstat_checkout_output(int fd, const struct checkout *state, struct stat *st) return 0; } +#ifdef __MVS__ +void tag_file_as_working_tree_encoding(struct index_state *istate, char* path, int fd) { + struct conv_attrs ca; + convert_attrs(istate, &ca, path); + if (ca.attr_action != CRLF_BINARY) { + if (ca.working_tree_encoding) + __chgfdcodeset(fd, ca.working_tree_encoding); + else + __setfdtext(fd); + } + else { + __setfdbinary(fd); + } + + __disableautocvt(fd); +} +#endif + static int streaming_write_entry(const struct cache_entry *ce, char *path, struct stream_filter *filter, const struct checkout *state, int to_tempfile, @@ -138,6 +156,10 @@ static int streaming_write_entry(const struct cache_entry *ce, char *path, if (fd < 0) return -1; +#ifdef __MVS__ + tag_file_as_working_tree_encoding(state->istate, path, fd); +#endif + result |= stream_blob_to_fd(fd, &ce->oid, filter, 1); *fstat_done = fstat_checkout_output(fd, state, statbuf); result |= close(fd); @@ -374,6 +396,10 @@ static int write_entry(struct cache_entry *ce, char *path, struct conv_attrs *ca return error_errno("unable to create file %s", path); } +#ifdef __MVS__ + tag_file_as_working_tree_encoding(state->istate, path, fd); +#endif + wrote = write_in_full(fd, new_blob, size); if (!to_tempfile) fstat_done = fstat_checkout_output(fd, state, &st); diff --git a/environment.c b/environment.c index bb3c2a96a33..2e4d3a1e058 100644 --- a/environment.c +++ b/environment.c @@ -51,6 +51,9 @@ const char *git_hooks_path; int zlib_compression_level = Z_BEST_SPEED; int pack_compression_level = Z_DEFAULT_COMPRESSION; int fsync_object_files = -1; +#ifdef __MVS__ +int ignore_file_tags = 0; +#endif int use_fsync = -1; enum fsync_method fsync_method = FSYNC_METHOD_DEFAULT; enum fsync_component fsync_components = FSYNC_COMPONENTS_DEFAULT; diff --git a/git-compat-util.h b/git-compat-util.h index 3e7a59b5ff1..66e0abec24b 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -223,7 +223,15 @@ struct strbuf; #include #include #include +#ifdef __MVS__ +#define release stdlib_release +#define fetch stdlib_fetch +#endif #include +#ifdef __MVS__ +#undef fetch +#undef release +#endif #include #include #ifdef HAVE_STRINGS_H diff --git a/negotiator/default.c b/negotiator/default.c index 9a5b6963272..b1f9f153372 100644 --- a/negotiator/default.c +++ b/negotiator/default.c @@ -174,7 +174,7 @@ static int ack(struct fetch_negotiator *n, struct commit *c) return known_to_be_common; } -static void release(struct fetch_negotiator *n) +static void release_negotiator(struct fetch_negotiator *n) { clear_prio_queue(&((struct negotiation_state *)n->data)->rev_list); FREE_AND_NULL(n->data); @@ -187,7 +187,7 @@ void default_negotiator_init(struct fetch_negotiator *negotiator) negotiator->add_tip = add_tip; negotiator->next = next; negotiator->ack = ack; - negotiator->release = release; + negotiator->release_negotiator = release_negotiator; negotiator->data = CALLOC_ARRAY(ns, 1); ns->rev_list.compare = compare_commits_by_commit_date; diff --git a/negotiator/noop.c b/negotiator/noop.c index de39028ab7f..82089654d8b 100644 --- a/negotiator/noop.c +++ b/negotiator/noop.c @@ -30,7 +30,7 @@ static int ack(struct fetch_negotiator *n UNUSED, struct commit *c UNUSED) return 0; } -static void release(struct fetch_negotiator *n UNUSED) +static void release_negotiator(struct fetch_negotiator *n UNUSED) { /* nothing to release */ } @@ -41,6 +41,6 @@ void noop_negotiator_init(struct fetch_negotiator *negotiator) negotiator->add_tip = add_tip; negotiator->next = next; negotiator->ack = ack; - negotiator->release = release; + negotiator->release_negotiator = release_negotiator; negotiator->data = NULL; } diff --git a/negotiator/skipping.c b/negotiator/skipping.c index 5b91520430c..783b3f27e63 100644 --- a/negotiator/skipping.c +++ b/negotiator/skipping.c @@ -243,7 +243,7 @@ static int ack(struct fetch_negotiator *n, struct commit *c) return known_to_be_common; } -static void release(struct fetch_negotiator *n) +static void release_negotiator(struct fetch_negotiator *n) { clear_prio_queue(&((struct data *)n->data)->rev_list); FREE_AND_NULL(n->data); @@ -256,7 +256,7 @@ void skipping_negotiator_init(struct fetch_negotiator *negotiator) negotiator->add_tip = add_tip; negotiator->next = next; negotiator->ack = ack; - negotiator->release = release; + negotiator->release_negotiator = release_negotiator; negotiator->data = CALLOC_ARRAY(data, 1); data->rev_list.compare = compare; diff --git a/object-file.c b/object-file.c index 7c7afe57936..28e69ed1e33 100644 --- a/object-file.c +++ b/object-file.c @@ -43,7 +43,9 @@ #include "setup.h" #include "submodule.h" #include "fsck.h" - +#ifdef __MVS__ +#include <_Ccsid.h> +#endif /* The maximum size for an object header. */ #define MAX_HEADER_LEN 32 @@ -2478,6 +2480,68 @@ int index_fd(struct index_state *istate, struct object_id *oid, return ret; } +#ifdef __MVS__ +void validate_codeset(struct index_state *istate, const char *path, int* autoconvertToASCII) { + struct conv_attrs ca; + struct stat st; + unsigned short attr_ccsid; + unsigned short file_ccsid; + + if (ignore_file_tags) + return; + + *autoconvertToASCII = 0; + convert_attrs(istate, &ca, path); + if (ca.attr_action == CRLF_BINARY) { + attr_ccsid = FT_BINARY; + } + else if (ca.working_tree_encoding) { + attr_ccsid = __toCcsid(ca.working_tree_encoding); + } + else + attr_ccsid = 819; + + if (stat(path, &st) < 0) + return; + + file_ccsid = st.st_tag.ft_ccsid; + + if (file_ccsid == FT_UNTAGGED) { + die("File %s is untagged, set the correct file tag (using the chtag command).", path); + } + + if (attr_ccsid != file_ccsid) { + if (file_ccsid == 1047 && attr_ccsid == 819) { + *autoconvertToASCII = 1; + return; + } + // Allow tag mixing of 819 and 1208 + if ((file_ccsid == 819 || file_ccsid == 1208) && (attr_ccsid == 1208 || attr_ccsid == 819)) { + return; + } + // Don't check for binary files, just add them + if (attr_ccsid == FT_BINARY) + return; + + char attr_csname[_XOPEN_PATH_MAX] = {0}; + char file_csname[_XOPEN_PATH_MAX] = {0}; + if (attr_ccsid != FT_BINARY) { + __toCSName(attr_ccsid, attr_csname); + } else { + snprintf(attr_csname, _XOPEN_PATH_MAX, "%s", "binary"); + } + if (file_ccsid != FT_BINARY) { + __toCSName(file_ccsid, file_csname); + } else { + snprintf(file_csname, _XOPEN_PATH_MAX, "%s", "binary"); + } + die("%s added file: file tag (%s) does not match working-tree-encoding (%s)", path, file_csname, attr_csname); + } +} +#endif + + + int index_path(struct index_state *istate, struct object_id *oid, const char *path, struct stat *st, unsigned flags) { @@ -2485,11 +2549,25 @@ int index_path(struct index_state *istate, struct object_id *oid, struct strbuf sb = STRBUF_INIT; int rc = 0; +#ifdef __MVS__ + struct conv_attrs ca; + int autocvtToASCII; +#endif + switch (st->st_mode & S_IFMT) { case S_IFREG: +#ifdef __MVS__ + validate_codeset(istate, path, &autocvtToASCII); +#endif fd = open(path, O_RDONLY); if (fd < 0) return error_errno("open(\"%s\")", path); + +#ifdef __MVS__ + if (!autocvtToASCII) + __disableautocvt(fd); +#endif + if (index_fd(istate, oid, fd, st, OBJ_BLOB, path, flags) < 0) return error(_("%s: failed to insert into database"), path); diff --git a/read-cache.c b/read-cache.c index 080bd39713b..75c06121302 100644 --- a/read-cache.c +++ b/read-cache.c @@ -205,6 +205,9 @@ static int ce_compare_data(struct index_state *istate, int fd = git_open_cloexec(ce->name, O_RDONLY); if (fd >= 0) { +#ifdef __MVS__ + __disableautocvt(fd); +#endif struct object_id oid; if (!index_fd(istate, &oid, fd, st, OBJ_BLOB, ce->name, 0)) match = !oideq(&oid, &ce->oid); diff --git a/utf8.c b/utf8.c index 6a0dd25b0fe..b9cb56abf14 100644 --- a/utf8.c +++ b/utf8.c @@ -590,6 +590,17 @@ char *reencode_string_len(const char *in, size_t insz, #endif } +#ifdef __MVS__ + //HACK: For backwards compat, ISO8859-1 really means utf-8 in the z/OS world + if (strcasecmp("ISO8859-1", in_encoding) == 0) { + in_encoding = "UTF-8"; + out_encoding = "UTF-8"; + } + if (strcasecmp("ISO8859-1", out_encoding) == 0) { + in_encoding = "UTF-8"; + out_encoding = "UTF-8"; + } +#endif conv = iconv_open(out_encoding, in_encoding); if (conv == (iconv_t) -1) { in_encoding = fallback_encoding(in_encoding); From patchwork Mon Nov 13 10:24:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haritha D X-Patchwork-Id: 13453770 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A949319BBD for ; Mon, 13 Nov 2023 10:24:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XB330UzV" Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1744310DB for ; Mon, 13 Nov 2023 02:24:22 -0800 (PST) Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-4083cd3917eso34522845e9.3 for ; Mon, 13 Nov 2023 02:24:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699871060; x=1700475860; darn=vger.kernel.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=YwDa/zirDJc5nfx2Jg49qoDCUK60ez7e62AeKwMOj8I=; b=XB330UzVLnDWNbUJfx8A74xYAmnYVmz3n5LyC4IxVTsC28aN74yimtBhWQxnMm8ak5 6KAo2wATt+RJ/zXnLnybqS3aCmcpcy+CkKOPfENNqCXRyWeaJ35iPJCDRIrdATeKHXOx McaeqtwxrZM15AWrp7Mk7opd9DcjEN6SrLMquorUZTI+6SOWA8e7ozA2EApL3XGFWpWH beVkhxFVFIMOnAcC/kF75++FUnlBfjkGLJqMI/pNdKxSDqO4RQl1VA0SvMK1uXNZ/5RB 9yvO8s7K9quTOUOEx8zklyukgFESICK1GvPs5f7DDqSwgT4EqIiOI0o4OtPS9FjB2TxZ /ilg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699871060; x=1700475860; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YwDa/zirDJc5nfx2Jg49qoDCUK60ez7e62AeKwMOj8I=; b=qoBKmCWJBRlgjIZXAkzeXyiqHNp2xfZf4CcsFelYpskT4tFHbQI8Vp7w5FBsX9V/GS YTSfd52jm80KsFcmmmZUH2XRQOGHIKzgrXDL4bIt/5Ct3EVoetrifJazWzG6XzqpTAqA 8/rfqm3ytxWaHmYtKdlHJmw3xFLNhY0zkrcnBsAUYf6Z6IxWF20ieev8V2++AkvLzfbj BqEi/Iv4fnQiNhu6KyHHqEARziBqplg1a+0nqfmktRpBEoc4ZywwXhFjYj5rD7loVTJ8 X0uTFfL3aq6MF3CoIbQ12G1oMzKtcK7scQI5Y8jP1h9U3LL5N3Ab7dfwvMQ6A0oRCJg5 LwSw== X-Gm-Message-State: AOJu0YyMFyq+w9kyH0zfRpCj7i0XSZ73zanL3JY9ts3gdHiXZyl/4P6E RbWRIlRB1K6nGj4wvdk3nTZL/egrEZ0= X-Google-Smtp-Source: AGHT+IFfjNvSHy4dLNK9YFHagGZP5725qzr6BCHPm7tHvh2FhK0vaniXd3CbX9mokNCCKhyKWZxYFg== X-Received: by 2002:a05:600c:6001:b0:409:7d0:d20b with SMTP id az1-20020a05600c600100b0040907d0d20bmr5143353wmb.24.1699871059593; Mon, 13 Nov 2023 02:24:19 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id y4-20020a5d4ac4000000b0032dbf32bd56sm5062384wrs.37.2023.11.13.02.24.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 02:24:19 -0800 (PST) Message-ID: In-Reply-To: References: Date: Mon, 13 Nov 2023 10:24:05 +0000 Subject: [PATCH 03/13] spaces and errors fix Handled git pipeline errors Fcc: Sent Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 To: git@vger.kernel.org Cc: Haritha , Haritha D From: Haritha D From: Haritha D This PR has fixes to enable build on z/OS Signed-off-by: Harithamma D --- builtin/hash-object.c | 6 +++--- convert.c | 22 +++++++++++++++++----- entry.c | 22 +++++++++++----------- object-file.c | 6 +++--- 4 files changed, 34 insertions(+), 22 deletions(-) diff --git a/builtin/hash-object.c b/builtin/hash-object.c index b33b32ff977..9129658a37c 100644 --- a/builtin/hash-object.c +++ b/builtin/hash-object.c @@ -62,8 +62,8 @@ static void hash_fd(int fd, const char *type, const char *path, unsigned flags, # include # include - int setbinaryfd(int fd) - { +int setbinaryfd(int fd) +{ attrib_t attr; int rc; @@ -74,7 +74,7 @@ static void hash_fd(int fd, const char *type, const char *path, unsigned flags, rc = __fchattr(fd, &attr, sizeof(attr)); return rc; - } +} # endif #endif diff --git a/convert.c b/convert.c index 4f14ff6f1ed..17cc849efed 100644 --- a/convert.c +++ b/convert.c @@ -1315,15 +1315,28 @@ static struct attr_check *check; static const char* get_platform() { struct utsname uname_info; + char *result; + if(!uname_info.sysname) + { + result = (char *)malloc(strlen(uname_info.sysname)+1); + int index=0; + while(index <= strlen(uname_info.sysname)) + { + *result = uname_info.sysname[index]; + ++result; + ++index; + } + } if (uname(&uname_info)) die(_("uname() failed with error '%s' (%d)\n"), strerror(errno), errno); - if (!strcmp(uname_info.sysname, "OS/390")) - return "zos"; - return uname_info.sysname; + if (!strcmp(uname_info.sysname, "OS/390")) + result="zos"; + + return result; } @@ -1331,11 +1344,10 @@ void convert_attrs(struct index_state *istate, struct conv_attrs *ca, const char *path) { struct attr_check_item *ccheck = NULL; - struct strbuf platform_working_tree_encoding = STRBUF_INIT; + struct strbuf platform_working_tree_encoding = STRBUF_INIT; strbuf_addf(&platform_working_tree_encoding, "%s-working-tree-encoding", get_platform()); - if (!check) { check = attr_check_initl("crlf", "ident", "filter", "eol", "text", "working-tree-encoding", platform_working_tree_encoding.buf, diff --git a/entry.c b/entry.c index df6feb2234b..f2a7b2adbf5 100644 --- a/entry.c +++ b/entry.c @@ -130,17 +130,17 @@ int fstat_checkout_output(int fd, const struct checkout *state, struct stat *st) void tag_file_as_working_tree_encoding(struct index_state *istate, char* path, int fd) { struct conv_attrs ca; convert_attrs(istate, &ca, path); - if (ca.attr_action != CRLF_BINARY) { - if (ca.working_tree_encoding) - __chgfdcodeset(fd, ca.working_tree_encoding); - else - __setfdtext(fd); - } - else { - __setfdbinary(fd); - } - - __disableautocvt(fd); + if (ca.attr_action != CRLF_BINARY) { + if (ca.working_tree_encoding) + __chgfdcodeset(fd, ca.working_tree_encoding); + else + __setfdtext(fd); + } + else { + __setfdbinary(fd); + } + + __disableautocvt(fd); } #endif diff --git a/object-file.c b/object-file.c index 28e69ed1e33..562d1344422 100644 --- a/object-file.c +++ b/object-file.c @@ -2557,15 +2557,15 @@ int index_path(struct index_state *istate, struct object_id *oid, switch (st->st_mode & S_IFMT) { case S_IFREG: #ifdef __MVS__ - validate_codeset(istate, path, &autocvtToASCII); + validate_codeset(istate, path, &autocvtToASCII); #endif fd = open(path, O_RDONLY); if (fd < 0) return error_errno("open(\"%s\")", path); #ifdef __MVS__ - if (!autocvtToASCII) - __disableautocvt(fd); + if (!autocvtToASCII) + __disableautocvt(fd); #endif if (index_fd(istate, oid, fd, st, OBJ_BLOB, path, flags) < 0) From patchwork Mon Nov 13 10:24:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haritha D X-Patchwork-Id: 13453771 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5903A1CA9F for ; Mon, 13 Nov 2023 10:24:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UhksqixC" Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FF2CD78 for ; Mon, 13 Nov 2023 02:24:23 -0800 (PST) Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-32daeed7771so2402308f8f.3 for ; Mon, 13 Nov 2023 02:24:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699871061; x=1700475861; darn=vger.kernel.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=JLLoRClaRsY1Lr1KRBPf00edL9rjXGTDv1wSMzbaP0M=; b=UhksqixCPWQ6OKnrJYp92dt5jvqsxLDx8MReK63lu45KrQwnRUsMaZTmCA3cezmsrn QG79+6iv2hXCUrUI73TtPfETSrb1r19zUOrfs6RcmjwqzH9Rll2q3jTn5hb41evmLep1 USCdrevQSoHXhZLr2SKecLZDInYNnm6l5USxP182tg8wZKnBeCW8lMTbrDzRMG7v7zsr R6xvWV8Pl4w4CguvvBXa8fCLIpNS/le/Y5bG/KKpcpZkxyu8isG9CGnlCLqrzEc4FvD2 q+iJk4F/6dF6h+M6ZjkHqElgkD6IqD0FFcCNa/4jrTVva18M4qFKLsJIiYcLtjC6Aecq fsRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699871061; x=1700475861; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JLLoRClaRsY1Lr1KRBPf00edL9rjXGTDv1wSMzbaP0M=; b=b2wFxRF8S0vgsX7LZxE9GtvtCOxZU6iS0qAamU3m/PYrd5XozMjNVXbfoYwsNA/J06 q7nfSu+QkDUNjRKrPPVFXAlIkyPw5+qp9JLyVcU+Ir6VnQr1Zm79fMaxL50FNBTNpVtv KNprnsIfWETO+2UhMDI+Ta/sNkfbz49DAPXgKzyWNZ+7wcGm+djKhhYolxylG98Cb/Th 8FLRR6MnEogljRlwhBoETFF8QNVhuyj3Zdo1fNCPBAtZu4C3mlPz1dyGUBucKEgKfedf v6u5/Npzt50rN32TQZaLm0f+3y/XVUPdRE1VxeuxP2gUic4ivC/f5JalGAowc5TYeHec bXmA== X-Gm-Message-State: AOJu0YwUBAxEtElq9TDbpoCXs30TIyYAK+pcxAG78vD3GVaJN2ztmvI4 Kkb6s5w6UBMCo6rTOzw9AN/FlvOilRs= X-Google-Smtp-Source: AGHT+IFSSd76ceupoSRBEl9Of6/ephExeVzJ4Sz0TdoQ7Md6AvzHCqqgxyFryjpV/R9IZwCVAWcXLw== X-Received: by 2002:a5d:64ee:0:b0:32d:a0a9:4785 with SMTP id g14-20020a5d64ee000000b0032da0a94785mr4350853wri.7.1699871061023; Mon, 13 Nov 2023 02:24:21 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id g26-20020adfa49a000000b0030647449730sm5157093wrb.74.2023.11.13.02.24.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 02:24:19 -0800 (PST) Message-ID: <7bace397b4a4ea49c1ad5b931a0d07493fe44a16.1699871056.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Mon, 13 Nov 2023 10:24:06 +0000 Subject: [PATCH 04/13] fixes for build errors Handled git pipeline errorse Fcc: Sent Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 To: git@vger.kernel.org Cc: Haritha , Haritha D From: Haritha D From: Haritha D This PR has fixes to enable build on z/OS Signed-off-by: Harithamma D --- convert.c | 4 ++-- fetch-negotiator.h | 2 +- fetch-pack.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/convert.c b/convert.c index 17cc849efed..da05f6c2e51 100644 --- a/convert.c +++ b/convert.c @@ -1313,13 +1313,13 @@ static int git_path_check_ident(struct attr_check_item *check) static struct attr_check *check; -static const char* get_platform() { +static const char* get_platform(void) { struct utsname uname_info; char *result; if(!uname_info.sysname) { - result = (char *)malloc(strlen(uname_info.sysname)+1); int index=0; + result = (char *)malloc(strlen(uname_info.sysname)+1); while(index <= strlen(uname_info.sysname)) { *result = uname_info.sysname[index]; diff --git a/fetch-negotiator.h b/fetch-negotiator.h index e348905a1f0..2e19ef247f9 100644 --- a/fetch-negotiator.h +++ b/fetch-negotiator.h @@ -47,7 +47,7 @@ struct fetch_negotiator { */ int (*ack)(struct fetch_negotiator *, struct commit *); - void (*release)(struct fetch_negotiator *); + void (*release_negotiator)(struct fetch_negotiator *); /* internal use */ void *data; diff --git a/fetch-pack.c b/fetch-pack.c index 26999e3b659..f40b90dfa65 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -1232,7 +1232,7 @@ static struct ref *do_fetch_pack(struct fetch_pack_args *args, all_done: if (negotiator) - negotiator->release(negotiator); + negotiator->release_negotiator(negotiator); return ref; } From patchwork Mon Nov 13 10:24:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haritha D X-Patchwork-Id: 13453772 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9B53F1CAA8 for ; Mon, 13 Nov 2023 10:24:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CHregjOM" Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15DEA10CB for ; Mon, 13 Nov 2023 02:24:24 -0800 (PST) Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2c50ec238aeso60009231fa.0 for ; Mon, 13 Nov 2023 02:24:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699871061; x=1700475861; darn=vger.kernel.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=Lmp+39K4XkQih0RiO3PzbCM/gqqcmND2ys2ZgjDpzJs=; b=CHregjOMVF7RQadeiDyMMtK4YZsNltYfGgeUbDbqIBXwz1+Ax0nfYL3VRoLiYSxlju fdDoFzXM4Y1YFX/AYdkW0FLvv6spwHzXiQiDge4jG/OlDwJcovNdGu1p63u2GoqOag5s iniqeQcGy7PALDOxC7S8+/G9/jxNk/r9pyxymz59+F/AcM5qwlrEl0EtM3hYyyluTulH MuG7KqVP4uGmM3usVRU25mJE+MyIPCTNyGd1kRBpZaLnUGgel6OWc8LL3CQD2U7zJ7DP 2qQwg2tuTxrUywVBoVey/RyrjOiDL91dwPmf3Us2pk2kKnr58x1vjrkKpdHLe6vygrHO kyWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699871061; x=1700475861; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Lmp+39K4XkQih0RiO3PzbCM/gqqcmND2ys2ZgjDpzJs=; b=SEKvzIoiyFVOaDr464/gt8Dz2G2ZEp5Ppsb7C9BAZx30rK3nV3UWZnfNXIsVbX/YfD G0gURlJxuXp2YzB8iIzigauSCcxNIxTFl5oR2pD1mum04IFX58xschrGHzH1W1NeJpb3 k2RHQqSp/zkmngyJjJiqiMCCKQKoxS7abrNW56pUR/lchJaCJjvXlwe1JKbX9b21vOTD sZaGcGOER4DLKgz7UjlOfMfWX+MX8PW8QogNCTNQpp0U4bnzrnzsX/M3+Duv/ejCKawD qoSODPqZV58BOdTifO/Kkhh7fLiM0qOXE3AgL6ozr89dYQhBXDf6tANXoVtl44DBUFHt kFmw== X-Gm-Message-State: AOJu0Yz0fe+KoFg8yFFC5tOAre2k7bA9ivlmv7L1NWKCNYYJpHQX2ep5 hOk9HjkHscc4zhCrnZYvZILMG2yn+mY= X-Google-Smtp-Source: AGHT+IFeKsBTN2brpOU4Y3AL5WrMUbO3zqWkwkGtPlUjD+CaUdIPhECZ+XHs5Y79IqA/yu1+3CSnlQ== X-Received: by 2002:a2e:6e19:0:b0:2c5:23e3:ed11 with SMTP id j25-20020a2e6e19000000b002c523e3ed11mr4976884ljc.30.1699871061504; Mon, 13 Nov 2023 02:24:21 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id be14-20020a05600c1e8e00b00401b242e2e6sm13340554wmb.47.2023.11.13.02.24.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 02:24:21 -0800 (PST) Message-ID: <3b6d1f8066841e87bbbd31c55226209e54c64e03.1699871056.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Mon, 13 Nov 2023 10:24:07 +0000 Subject: [PATCH 05/13] fixes for build errors Fcc: Sent Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 To: git@vger.kernel.org Cc: Haritha , Haritha D From: Haritha D From: Haritha D This patch has fixes for build errors Signed-off-by: Haritha D --- convert.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/convert.c b/convert.c index da05f6c2e51..d3f204b4c29 100644 --- a/convert.c +++ b/convert.c @@ -1315,8 +1315,8 @@ static struct attr_check *check; static const char* get_platform(void) { struct utsname uname_info; - char *result; - if(!uname_info.sysname) + char *result = NULL; + if(!uname_info.sysname[0]) { int index=0; result = (char *)malloc(strlen(uname_info.sysname)+1); From patchwork Mon Nov 13 10:24:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haritha D X-Patchwork-Id: 13453773 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CDAF21CAAD for ; Mon, 13 Nov 2023 10:24:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Bwi7jvI3" Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A08AC10CC for ; Mon, 13 Nov 2023 02:24:24 -0800 (PST) Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-33139ecdca7so1754315f8f.0 for ; Mon, 13 Nov 2023 02:24:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699871063; x=1700475863; darn=vger.kernel.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=cPqd1t2iqwP/PGL/YZtl1KKlvVh1MN2oaFwBpr+oq44=; b=Bwi7jvI3Q0yiE5eGa/MLlnNfY+9KIDtBLgLuZP6J6vP6g2Y/EJYRWRl3mvV4XXUuuV huM92GjAjL+DQaeE4ir2EmjGfAnkSZUA4sOaTOLKMMtD4JdK25tdCn3mXdYNXp7iYVSg bPZqzEgtzHdNXb6ZznRi6cVdNrn1JOYH9onf+O7gXfgpC/sq48OL+OnHbvqRBSW3kONj w3DgmBV0dXSzR2/HmcrTFu6A+Ofye5TFCdOm0Qt16Yc9G3JugwjA2iaN5OaR6fBe/Y+z hCUszECXu8sURWmrfZGYI4Upq1CMrty6eB6micp24yGKbRF7eg/MireyhVndEgPlHEIC Sozw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699871063; x=1700475863; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cPqd1t2iqwP/PGL/YZtl1KKlvVh1MN2oaFwBpr+oq44=; b=iefQ4cZuQa8eJsVxJLFk1kpB2l1btJZnVpsCuCj6jX+34Crf/ViKXPlX/gLLduQxfi XDC+fogLAzQNA2ZAReVi5HLRB/axqg2pc8doUxmMZY/+O8rTyN5MPwc47JznzbBQcYGr mddLKKSuTYOTAD3kIX5hzVpKOwVjlMiVjTzAeYKaSmydUQDvbrmr4H3WuWIVArQbxOrg Trr/NK+6ikUmtfXZ14DSW9xEPAOFOeaZBOiyoJq/ly+grCEkHoioUPQlyeZNyrUA8uxi uobBvU3rFHHZQEG+f/z+5APaBDqHjXZl2z44mp2eR3gMM7Kn7H8nAzmvj2/OpvTZR966 05pA== X-Gm-Message-State: AOJu0YwzfBIqoUG3Dj+D8IPfsNAhisUNXjbhTC2u8L25ZKshnt8r7E/5 GjMOT0C+AA234AvwOpJ/IFE2yH+rUTM= X-Google-Smtp-Source: AGHT+IE3DEg7YhoEyyyKo10jcQNX1UiG4e0UdygPOpReE11kLAzKg47OC/Q3TyB0ICZKJN6es2od5Q== X-Received: by 2002:adf:9c8a:0:b0:32d:a41b:bd47 with SMTP id d10-20020adf9c8a000000b0032da41bbd47mr5538583wre.59.1699871062928; Mon, 13 Nov 2023 02:24:22 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id q2-20020a056000136200b003313a1e0ba1sm5075128wrz.89.2023.11.13.02.24.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 02:24:21 -0800 (PST) Message-ID: <3c9b02e18d232fbccf27c4e95d8b3193ba9348a2.1699871056.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Mon, 13 Nov 2023 10:24:08 +0000 Subject: [PATCH 06/13] spaces and errors fix Handled git pipeline errors Fcc: Sent Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 To: git@vger.kernel.org Cc: Haritha , Haritha D From: Haritha D From: Haritha D This PR has fixes to enable build on z/OS Signed-off-by: Harithamma D --- convert.c | 2 +- fetch-pack.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/convert.c b/convert.c index d3f204b4c29..7fe107710ec 100644 --- a/convert.c +++ b/convert.c @@ -1314,7 +1314,7 @@ static int git_path_check_ident(struct attr_check_item *check) static struct attr_check *check; static const char* get_platform(void) { - struct utsname uname_info; + struct utsname uname_info = {0}; char *result = NULL; if(!uname_info.sysname[0]) { diff --git a/fetch-pack.c b/fetch-pack.c index f40b90dfa65..c1f2e714f8e 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -1853,7 +1853,7 @@ static struct ref *do_fetch_pack_v2(struct fetch_pack_args *args, die("fsck failed"); if (negotiator) - negotiator->release(negotiator); + negotiator->release_negotiator(negotiator); oidset_clear(&common); return ref; From patchwork Mon Nov 13 10:24:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haritha D X-Patchwork-Id: 13453775 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 819931CAB9 for ; Mon, 13 Nov 2023 10:24:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TVoLJ5FC" Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52011135 for ; Mon, 13 Nov 2023 02:24:25 -0800 (PST) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4083f613272so36825975e9.1 for ; Mon, 13 Nov 2023 02:24:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699871063; x=1700475863; darn=vger.kernel.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=k1SqGzecIQuCC0UhVUCjftVl3lukEA9o5AFyqr5KdQY=; b=TVoLJ5FCLGg4XR7wVeRhEJsKlHM+G3tyasoqbPCdWErAwyEvxtjYqdSxMrQlcUVzZu I/lvLUzCyNwRBi7miqWAPKgPumCS6zXZcwzrBivRa+T7Czzy1t4EWxpC7uOjvZvx9Nun tJAcM663S6YJcPysodq1VwPyX0G+wBlQE+pXzZY76bizB7jCkHrq8hOYmuMvKWNdP/+S 4RDWDWU12tPnAAB4zCszQmCfE6SGojQVnqx28oCRtxk2Kv2Kp0nnL2aK7v+Y28xjnyp7 UsmIWI5ey8rUh9mcsYPhXYXyb4YOVO2qI3FqjsybPGh+WYesAh3NexKbYX7Kb439b8Xb xmPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699871063; x=1700475863; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=k1SqGzecIQuCC0UhVUCjftVl3lukEA9o5AFyqr5KdQY=; b=BQQ8a8+akjg3rwiFHS2wwIkA8TuuQhmtG3HSEciJJlnrfXyQLeGoftj7BTkXg2+zwQ p6W2pbgY1oKACP8LwjSupnFbo68W329eqw4kkUjJhSCc+SXc71ZyWwWdjgpfvUj/32Vm lRUb71BqxJfL2vIeCHIH/UPfIuWsZEH5FHgW3es3asjftEgmbDpAS2qGPFt5bdgLjspv 8Cp/WwEC6c8GDCsDbhG5khFiGkgNCvV61H+i6dceACkzcAc2JuZhoqZsGP3wt4mafI7B hfX66uGKXEnHvtS71kYe67r8FBWtISWrPXMIdFAdTBUsbwaKKm7luK2Axqsv1S+BVj8k M7iQ== X-Gm-Message-State: AOJu0YwMGM8bUUBt9QEsFGoDIaReFhadMOILlTIw1K/8IsaBc1wR6kkx HAzaA8k0cCbUkUimOxEPSSaZQC/K9iU= X-Google-Smtp-Source: AGHT+IFpCZbmqipbO/0rRw1JIEFtoanJSsp2df7KKS8iGnjjnI8eqqA5q0qbP5hQGrLV2bCihM0MpA== X-Received: by 2002:a5d:4807:0:b0:32f:88d1:218c with SMTP id l7-20020a5d4807000000b0032f88d1218cmr3736183wrq.35.1699871063588; Mon, 13 Nov 2023 02:24:23 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id w10-20020a5d4b4a000000b003313426f136sm5031984wrs.39.2023.11.13.02.24.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 02:24:23 -0800 (PST) Message-ID: <8165196f869267ff35d2b252c20a622013b0fb04.1699871056.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Mon, 13 Nov 2023 10:24:09 +0000 Subject: [PATCH 07/13] spaces and errors fix Handled git pipeline errors Fcc: Sent Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 To: git@vger.kernel.org Cc: Haritha , Haritha D From: Haritha D From: Haritha D This PR has fixes to enable build on z/OS Signed-off-by: Harithamma D --- convert.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/convert.c b/convert.c index 7fe107710ec..c8d30011458 100644 --- a/convert.c +++ b/convert.c @@ -1314,9 +1314,15 @@ static int git_path_check_ident(struct attr_check_item *check) static struct attr_check *check; static const char* get_platform(void) { - struct utsname uname_info = {0}; + struct utsname uname_info; char *result = NULL; - if(!uname_info.sysname[0]) + + if (uname(&uname_info) < 0) + die(_("uname() failed with error '%s' (%d)\n"), + strerror(errno), + errno); + + if(*uname_info.sysname != '\0') { int index=0; result = (char *)malloc(strlen(uname_info.sysname)+1); @@ -1326,15 +1332,13 @@ static const char* get_platform(void) { ++result; ++index; } + *result = '\0'; } - if (uname(&uname_info)) - die(_("uname() failed with error '%s' (%d)\n"), - strerror(errno), - errno); - +#ifdef __MVS__ if (!strcmp(uname_info.sysname, "OS/390")) result="zos"; +#endif return result; } From patchwork Mon Nov 13 10:24:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haritha D X-Patchwork-Id: 13453774 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6EA4F1CA9A for ; Mon, 13 Nov 2023 10:24:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PjnWKUlM" Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D74210DA for ; Mon, 13 Nov 2023 02:24:26 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-32fadd4ad09so2911311f8f.1 for ; Mon, 13 Nov 2023 02:24:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699871064; x=1700475864; darn=vger.kernel.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=x7Z2SUGa5/0f57Akh4kSw94/5o3v4clvIxdPXNrUx8o=; b=PjnWKUlMhrmUN7fss++PGbFNIGhA7iLmGA2NpIOswz0dE9arASA6ZnXOfuCyjfm3m4 AULcoSoWtgY1tmhHfdfa24sva2sfYxYz+qW8jMbMchYbc7YyNxGYHFXqgdc/ELaUzS9T G5JSdalwmItFQKKNJa0NzCHqTie+o8/YPvR9/TaswAGnfzYAEQKM9tGBZgTmDH/o73zS I9pexsDcG8YRFySnAT5yy6MnHBghn6Wy3K2f0Oyttapys4WQBuJgzrsrejDn5wdmlyyK 1S+y/ynW8RuaCVGETUnoEtmmXDGAZUAKDT7VK1FsIVGAeXkO9pTLzne+q66u73v8u3sZ DUMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699871064; x=1700475864; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=x7Z2SUGa5/0f57Akh4kSw94/5o3v4clvIxdPXNrUx8o=; b=X9+lcNi5kElGRChysUtCBHx+7hb1xuDcSeO7+QeAwtiAlCmLmKwAz8gKZ7ZJ/cx7bh f5icuKzuoiZop50ZoBkhREOBZPWGo0fXO7bQIfRPwKP7u2XgEN/Uv/TabgXAORrPN+zh qEYDNNVmgDHvHzwqJgfg3pJXrN/mb5HkY9sOU7xy2Nz/MtX8qPHlWCBB3NlZIMR676ES nJlrpAvb+qithFZvGjnskisLfLckmlDwectAih7iI9LNatjWDudJ8GnMqbIbMdfXS8A7 y59G7Hua2QYJg4GCku1ei2FV/SqvjzOMf0/A1VjkaaJwr651LUaRM1bekhBxOGBsFtME Q9Cw== X-Gm-Message-State: AOJu0YwojP2qC1IW8EFDqGoEzzaeqCnZpad2gDrXshDLXY56qq0Z/wtw vqetBdGIXTcsz0pitADnsj+YmIan7v0= X-Google-Smtp-Source: AGHT+IEV8LquFaL03N+njJqdGvuEkMgL5Ja74l3vmXxP8O6qHOjsdfAtPUhzeWmlERN3jMZU2Z+JRA== X-Received: by 2002:a05:6000:178b:b0:32f:8a08:3617 with SMTP id e11-20020a056000178b00b0032f8a083617mr4449961wrg.5.1699871064204; Mon, 13 Nov 2023 02:24:24 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id u25-20020adfa199000000b0032fb46812c2sm5135018wru.12.2023.11.13.02.24.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 02:24:23 -0800 (PST) Message-ID: <9fb74d92e3f5b7209478c8040312277cc27431c1.1699871056.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Mon, 13 Nov 2023 10:24:10 +0000 Subject: [PATCH 08/13] platform_name fix Handled git pipeline errors Fcc: Sent Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 To: git@vger.kernel.org Cc: Haritha , Haritha D From: Haritha D From: Haritha D This PR has fixes to enable build on z/OS Signed-off-by: Harithamma D --- 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")) From patchwork Mon Nov 13 10:24:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haritha D X-Patchwork-Id: 13453776 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1870F1CF87 for ; Mon, 13 Nov 2023 10:24:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bhk+3Gg1" Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E284D10D1 for ; Mon, 13 Nov 2023 02:24:26 -0800 (PST) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-40853c639abso32941505e9.0 for ; Mon, 13 Nov 2023 02:24:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699871065; x=1700475865; darn=vger.kernel.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=Ce1NKfuCYfRp0Jih5UaMPme/cdG124N0f9WMcvBTddA=; b=bhk+3Gg1VIIlFFUEBA9zB6VUVQe/pQBKZdg4HepHOvV93xfRLeADWnma2Jnu7LzTcE +9/8eoh535jN2bnd6eOXDKWNqxHuPlIcZawZJfophGuv2sQXrV+dAsHm8dk3S0+hOwOK TXSm/SNERbT2Bgykyc5iHa4Jh1orHjDeUXp+OwigcIlTzKVmwMAsSJDG7DNB7Zay/t14 yZc8yjbe3v+qS0yiAsgPDe44jCIRfTb2lF/u9fqwsf5o3XDBIdwZ1qgWVeB09+y+ZDFT KeBx3iVfnpOdYtpTfsZvuX4Psb/exE2wE2nk5zmbHxB4eaMa0KyDEy/METHSUD0fJFv8 gh+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699871065; x=1700475865; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ce1NKfuCYfRp0Jih5UaMPme/cdG124N0f9WMcvBTddA=; b=h0ZhOYFsFxGwtU5vSplSU37EjKQlPZmDTYUct1oOIAaYzwxGJCRaZ8P0aL3ysMW7H/ CGNq79me8rs0p09n5hiCVg9ZSftf2RAhPEfkYrbPUo7qxJbh/9q6W5zQ7UyvWwoR7+CI Vx4E+WpqHpscCXOGWeX+aR+er/qY3EzeaWuKJ04epuT0KAS83uO+kifs5srpcbnEQQkF 8agBtTaLvmHRDMks9D3nsiqJyxEWqgIM55BWANgEGpK9m4zthPP/39c6Y3M9Y/EFUOdz UtRlWjCK3NAQVBM1uopSVk/sC7JNI27quaZJ3/oFdUVbVtnLVSFlFGQVu+wCvr2Ajss2 ygow== X-Gm-Message-State: AOJu0YxaieXm/n/WUrrvFYn7MTgxLM+WXM4Rt3V24Kv4TnEgYkjh4SNg 67xzc9eCBsLHMcjDwEJStWVTMJkgh5Y= X-Google-Smtp-Source: AGHT+IGenyzMOPQyVKwkci660ixXul6eHegAp0hdcuK2RO5xYXqoSS8XhnbxH9owi6gwWe9t67rciQ== X-Received: by 2002:a05:6000:1865:b0:32f:a48f:3658 with SMTP id d5-20020a056000186500b0032fa48f3658mr6823864wri.69.1699871064788; Mon, 13 Nov 2023 02:24:24 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id e17-20020adfe391000000b0032fb7b4f191sm5056478wrm.91.2023.11.13.02.24.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 02:24:24 -0800 (PST) Message-ID: <8fa15ac45f78fbf0fda321a073a1020a471ee479.1699871056.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Mon, 13 Nov 2023 10:24:11 +0000 Subject: [PATCH 09/13] strncpy fix Handled git pipeline errors Fcc: Sent Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 To: git@vger.kernel.org Cc: Haritha , Haritha D From: Haritha D From: Haritha D This PR has fixes to enable build on z/OS Signed-off-by: Harithamma D --- convert.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/convert.c b/convert.c index 9cd0c1382ac..78403de422d 100644 --- a/convert.c +++ b/convert.c @@ -1326,7 +1326,13 @@ static const char* get_platform(void) { { int index=0; result = (char *)malloc(strlen(uname_info.sysname)+1); - strncpy(result, uname_info.sysname, strlen(uname_info.sysname)); + while(index <= strlen(uname_info.sysname)) + { + *result = uname_info.sysname[index]; + ++result; + ++index; + } + *result = '\0'; } #endif From patchwork Mon Nov 13 10:24:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haritha D X-Patchwork-Id: 13453778 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 780C11CF94 for ; Mon, 13 Nov 2023 10:24:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EyX1Q2Xl" Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 175A1D78 for ; Mon, 13 Nov 2023 02:24:28 -0800 (PST) Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-40907b82ab9so30081675e9.1 for ; Mon, 13 Nov 2023 02:24:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699871066; x=1700475866; darn=vger.kernel.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=IBAwLXzLynV8FWD86zN6hgjuOZ1WVpty4nnZ40f/Fts=; b=EyX1Q2XlgOCtrKEcnDM2aoUkeLCmDhwJrl5ZLKrO1+Erwi/JnSOzTPAiCYe8xm53Qg 13wzd15m4z1igvpc+wgaN9etMGQa5TfGqvZ6A05pDSmjMlS+VmW6Si8M73CL3dm6u6FI xDNGUeNSxv+NM/O706uIUjslR4mHhEJHd1w+ccqj0CapGmXEesQCTB+zbiIoFPkYBFkn n1G3RvZ14yScck/uKdsEJR+Yz31xTRxscxHgwSeV7F1wweX5j7q1UHpd62/RH6T1i6fI NpST2IBggcnwolxJ40V7xn45Rsj9EjkUOJxWPk/nNMM+GzMywXlQhNKiQ8Hxquox+FoF 7Azw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699871066; x=1700475866; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IBAwLXzLynV8FWD86zN6hgjuOZ1WVpty4nnZ40f/Fts=; b=N2mVaFAQqvV3lkkvZfjvntRgnPSxOUqBPdhLAVK25P1iaNVLAqgGoHsEBl/5xSSKwH b0gW6e9zEeke8aTmruucq9Ee1kSAlaUrJmItM7UKXnaztuemS5BPSrHvfgxwd1ryxbSW TsfDvYs0YUIeyhQ2rA9k6H1/Mya10aaTxbeQd6cfXyyQvFcpAHOMl4G7OUgLgPI4z43j MuCI8pNPBb7wTyUe1fcjjdve22WzOMOndRKSfYPXtu0TGF5lMxmise+6WpSn64D7SWxy 9YC1hkhvH10yyVYuFlwY7FUlXNian22A6UyzV77M3ePG0cJww4LeuBir+4eiek/OR1g/ gNvQ== X-Gm-Message-State: AOJu0YwTnBGrw1Zter+5RaioeYqd39TUpUIAl6nTpB6fjXdM+G5LRNWo CIZ47dgCK8cHU5MTpBAFDMXsE6Yzm8c= X-Google-Smtp-Source: AGHT+IGOfQLVaQQfBRpwQn8FoywSUmVnLd39l8JsK/7IOiEu0h8S0YOXAmwHYM1zC4iYPZfM5dLRMw== X-Received: by 2002:a05:600c:1d09:b0:400:5962:6aa9 with SMTP id l9-20020a05600c1d0900b0040059626aa9mr8960496wms.11.1699871065925; Mon, 13 Nov 2023 02:24:25 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id bi15-20020a05600c3d8f00b004095874f6d3sm7634582wmb.28.2023.11.13.02.24.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 02:24:25 -0800 (PST) Message-ID: <63479fe36966bf3b1a8dbc3ae68f8558da4690bc.1699871056.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Mon, 13 Nov 2023 10:24:12 +0000 Subject: [PATCH 10/13] strncpy fix Handled git pipeline errors Fcc: Sent Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 To: git@vger.kernel.org Cc: Haritha , Haritha D From: Haritha D From: Haritha D This PR has fixes to enable build on z/OS Signed-off-by: Harithamma D --- convert.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/convert.c b/convert.c index 78403de422d..ef44e6429da 100644 --- a/convert.c +++ b/convert.c @@ -1326,13 +1326,10 @@ static const char* get_platform(void) { { int index=0; result = (char *)malloc(strlen(uname_info.sysname)+1); - while(index <= strlen(uname_info.sysname)) + while(result[index] = uname_info.sysname[index]) { - *result = uname_info.sysname[index]; - ++result; - ++index; + index++; } - *result = '\0'; } #endif @@ -1340,8 +1337,7 @@ static const char* get_platform(void) { if (!strcmp(uname_info.sysname, "OS/390")) result="zos"; #endif - - return result; + return (char*)result; } From patchwork Mon Nov 13 10:24:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haritha D X-Patchwork-Id: 13453779 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4CBB21D520 for ; Mon, 13 Nov 2023 10:24:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GkTaavoK" Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1340910DB for ; Mon, 13 Nov 2023 02:24:29 -0800 (PST) Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-408425c7c10so34617995e9.0 for ; Mon, 13 Nov 2023 02:24:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699871067; x=1700475867; darn=vger.kernel.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=C6zxYu78Dvi4CJ0XqMTsYTMxgCmJo23KM7DAqdnAnGw=; b=GkTaavoKm1AmfTxxWfCmpqP1OJxeayE0ZXrB1xG1l4deBjyDP+9rFoc3Max6iNTB5l Fe9LIThG8nYMhM292lyYsSokSsAoxPOLEp1QLmLz8Rpea7LFcWBFfSWYaLRrBio7zTIe eEGiUK5ysPDxauu8UqIy0gPRwGCDPiA4klmLVfIiLjnRdirZ4CMXXzSK7Up18ZqO2Kby VkxSWV6nHXSi5OYYRIULwDbdK5hnXXchoXmCXNE2mcFLKZDa8BTXDcMaqj5Ldt91Pxj1 54E+XqCaSljrPSi+JrWUxlT49fBapMLuyiVD7n3oMXo7J8XYTRH0cUjv+ltnUrv0OZwx wVEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699871067; x=1700475867; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=C6zxYu78Dvi4CJ0XqMTsYTMxgCmJo23KM7DAqdnAnGw=; b=tj3Tv/njlRZljouPZk4Gl8UGmsUcLPyNahb+3aqkPBmDU8s2HJo8VeXySQnzoWTdt/ yTx4O6TdQo6R9qsvITNBpBqzmvwDOyzPCa+fY7FR1a2qhXHBR9Vxc/1+coKlSeSgAAFb H25egjoD9puA8Be5CqsScw99izm28APnNxH60IsNnwyofm3re251De6fVh+yT+pRqGBE Ehg6H3y7RWf9C5XR7gQGqgaOxDq4McjdPDr9KNW1L8qubQT/CmecAV/JvIYQKmrIcslY Qy2L66AC/+fDOUvho5FSXhlOeOlLdEvN45scO5K/KzIdoxOQ07LjY5ylQ791KGazC+Hs a8Zg== X-Gm-Message-State: AOJu0YzQs95rWDOJY/1qtmEy6cqVIl04CWjW/TI7reG7ZVR9gI9fvhTj V2/j+ooGPYjfEXGlgQ/4c9iML5pcmDw= X-Google-Smtp-Source: AGHT+IGFLizMPdux8IPv0KQc63wyVBNBFAwSmmZM4gzmXYaKyjhAoZk1xDFe2wkVtBHp2r4o/rA7tg== X-Received: by 2002:adf:ee51:0:b0:32d:a717:717a with SMTP id w17-20020adfee51000000b0032da717717amr4762810wro.40.1699871066997; Mon, 13 Nov 2023 02:24:26 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id q2-20020a056000136200b003313a1e0ba1sm5075240wrz.89.2023.11.13.02.24.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 02:24:26 -0800 (PST) Message-ID: <25271363e573f05e390ec09bfd3906730cae30e6.1699871056.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Mon, 13 Nov 2023 10:24:13 +0000 Subject: [PATCH 11/13] strncpy fix Handled git pipeline errors Fcc: Sent Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 To: git@vger.kernel.org Cc: Haritha , Haritha D From: Haritha D From: Haritha D This PR has fixes to enable build on z/OS Signed-off-by: Harithamma D --- convert.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/convert.c b/convert.c index ef44e6429da..16173a1caf6 100644 --- a/convert.c +++ b/convert.c @@ -1326,8 +1326,9 @@ static const char* get_platform(void) { { int index=0; result = (char *)malloc(strlen(uname_info.sysname)+1); - while(result[index] = uname_info.sysname[index]) + while(index <= strlen(uname_info.sysname)) { + result[index] = uname_info.sysname[index]; index++; } } From patchwork Mon Nov 13 10:24:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haritha D X-Patchwork-Id: 13453780 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 14C6A1D548 for ; Mon, 13 Nov 2023 10:24:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CoEzTyV3" Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB2E910CB for ; Mon, 13 Nov 2023 02:24:29 -0800 (PST) Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-32f7c44f6a7so2491311f8f.1 for ; Mon, 13 Nov 2023 02:24:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699871068; x=1700475868; darn=vger.kernel.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=gEms6WLIUqM/ctvGUmXYH20+c1jatg0saT8hXhEJ0Vs=; b=CoEzTyV3hj9i3e1Vi4KKW3WI4/8pY3pJArvfKjVlv1TzwR17HFHiBp7FSIIBzg7lIq +GYV+rj2UA7c/c9V7KeunSNuupIW0pzboZ/Bn+cQz9jWo6heBOJILlfHJxjCAchvSLh9 a4zIqErSE+oJHiGPE16FNIIUhx3dZnsKI/LJnFhfCjyF27qVrcQiL6geM+5DwH7PZdml XVbi1fjmoGI/S5GZfHfxXK9TZKkMEv8XX+JJT1tKOibc/eHD3dOLR1Zzx4jFpW8MdDU6 MGvDSP/BuRSeFqerZkb+BQpr1L2tkysHNJqJddSjApA5doTM6/7JqGuQZFGGWHwwrWgi Cskg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699871068; x=1700475868; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gEms6WLIUqM/ctvGUmXYH20+c1jatg0saT8hXhEJ0Vs=; b=SzjvBhYOAeojBueaMgWRHcOo8LJqCbdUltrQpG+caqCuZmJIdaNT3U4/t21mdIVAW1 po1jSMS9J/RjZ5kD1XcbSL31YTcQl94HlDJoiX/K+RClRNvkXtEj0GuoVV1NEHiwpv1h ZFuXI0QSbT+fEsUIAtIcugYqi0PN8GI0XgS1X7EWz78AI6p2rGp2CedMWC7Ed9ujdB2F huuPk33DyYAD1UGcMfE2Sm3g2/7oo7zBrm2BUk2BNZqiyGn00c2BITmAgcP/V4LJHR4S lM59B9OHfxS2bX1t0I8BhfrPtZDjqfy8ZY3ZqcFlfCLFyO2ty4K0jFKfsUdc7DmILWL2 D1cQ== X-Gm-Message-State: AOJu0YziXoEdW8i5k9p2UPd2jds2i+ERKCWlz6t2hHACpafr7hu4bq9b kBqEOJIAr/uSS7Mjpsf9IIhrsz/dS98= X-Google-Smtp-Source: AGHT+IGMDv1zYmkU/56CGS6MIiacHPAHru4MJA5XsfAmaGn+CEE1yhDTjhBLHW7qQmpSjWYD25kG3Q== X-Received: by 2002:adf:d1e2:0:b0:32d:7162:7ffe with SMTP id g2-20020adfd1e2000000b0032d71627ffemr6327971wrd.69.1699871068025; Mon, 13 Nov 2023 02:24:28 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id c10-20020a5d63ca000000b0032d81837433sm5062977wrw.30.2023.11.13.02.24.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 02:24:27 -0800 (PST) Message-ID: <06658ebad1027cdc72d9dc013b7a022245dd22c9.1699871056.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Mon, 13 Nov 2023 10:24:14 +0000 Subject: [PATCH 12/13] Handled git pipeline errors - Memory leak Fcc: Sent Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 To: git@vger.kernel.org Cc: Haritha , Haritha D From: Haritha D From: Haritha D This PR has fixes to enable build on z/OS Signed-off-by: Harithamma D --- convert.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/convert.c b/convert.c index 16173a1caf6..4c034bb714c 100644 --- a/convert.c +++ b/convert.c @@ -1313,9 +1313,9 @@ static int git_path_check_ident(struct attr_check_item *check) static struct attr_check *check; -static const char* get_platform(void) { +static void get_platform(char** result) { struct utsname uname_info; - char *result = NULL; + *result = NULL; if (uname(&uname_info) < 0) die(_("uname() failed with error '%s' (%d)\n"), @@ -1325,10 +1325,10 @@ static const char* get_platform(void) { if(*uname_info.sysname != '\0') { int index=0; - result = (char *)malloc(strlen(uname_info.sysname)+1); + *result = (char *)malloc(strlen(uname_info.sysname)+1); while(index <= strlen(uname_info.sysname)) { - result[index] = uname_info.sysname[index]; + (*result)[index] = uname_info.sysname[index]; index++; } } @@ -1336,9 +1336,8 @@ static const char* get_platform(void) { #ifdef __MVS__ if (!strcmp(uname_info.sysname, "OS/390")) - result="zos"; + *result = "zos"; #endif - return (char*)result; } @@ -1347,8 +1346,11 @@ void convert_attrs(struct index_state *istate, { struct attr_check_item *ccheck = NULL; struct strbuf platform_working_tree_encoding = STRBUF_INIT; - - strbuf_addf(&platform_working_tree_encoding, "%s-working-tree-encoding", get_platform()); + char* result=NULL; + get_platform(&result); + strbuf_addf(&platform_working_tree_encoding, "%s-working-tree-encoding", result); + if (result != NULL) + free (result); if (!check) { check = attr_check_initl("crlf", "ident", "filter", From patchwork Mon Nov 13 10:24:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haritha D X-Patchwork-Id: 13453781 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 42E181D6AE for ; Mon, 13 Nov 2023 10:24:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="L4vp9rpJ" Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD188135 for ; Mon, 13 Nov 2023 02:24:30 -0800 (PST) Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4083ac51d8aso34464725e9.2 for ; Mon, 13 Nov 2023 02:24:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699871068; x=1700475868; darn=vger.kernel.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=Ywu1GD0bcFiXazAsX1oenp5ZSAPvDc198d9KjKr5MKw=; b=L4vp9rpJ7DjUTZVEt1UibENvekbmJEFT0qJE4JeMp5EoYjwtC+ypKA1f9U6BbzEid5 7871U2oH2EpB+jfOs1I+Ko71uSIg1GYvk5UhyN+hRDZio2619E98yugwJFyHlajgS52/ G75t7qpPb6CJjeGQWM7JDR5HDlmaDveYcbM6uiKOkbkjgaa2Fojg4vU0OUPIOVlPMpB1 SyByzd5ddFQrv5ygdl7bjz/nG5lQ8JVF2zoXzEuRBw1xl34VjRz1JcbU8f1fdheZfPxJ /E8WrbE03i6tEu0ALwMZDo7nhJuhal6EXdnNXyqeSWvK8lOK8XhPIy7y294h+cd6ZZni bm1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699871068; x=1700475868; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ywu1GD0bcFiXazAsX1oenp5ZSAPvDc198d9KjKr5MKw=; b=Kw5IfJAzVT9Ie3kWgy6XbeyJaQIG9WeWMUG60fZxFUlQHE2eL6fxC9fPEX1v3yOjSk jXQ5ZcWTTPafVygImMk+e7BwpHzggda82ixBEtgCucr/bmRyW420Bq/bk1rMCmqaW6iN RLDSBXNQy+VMuKX69tUYf2n0O3ueKXiVxfHaCKajWbWteW1+SkDGAfpW2OCLivYqX6T8 6AepIbzkixI2HPSCoqsrnd66UaCoi6AJIP+noy0OUWQIoCcfStUeOOT7mJDyDTEPP1xD yoNmc7Ut5kdt4s42/FszvaYsBpLVXacg9JZEsKdbpNml2AqcC+zoh/DVu2G25rtfxSBP 9vOA== X-Gm-Message-State: AOJu0YxUwDiPEYc1WHrYZeHp8XVGrrgQHQtTEBjb15PEtapdTeidiB0V HmoQU1NaYzD07P58zbM2YEIDNfEdpCQ= X-Google-Smtp-Source: AGHT+IHxW4fILADjsVNUxP8ObPMZP5Xdhxf9Iaq3zY+FO+KrKQ57zJFCmnqG6Jj4Vo0mAezvqIidIA== X-Received: by 2002:a05:600c:3b8b:b0:405:348e:aa43 with SMTP id n11-20020a05600c3b8b00b00405348eaa43mr5283502wms.12.1699871068617; Mon, 13 Nov 2023 02:24:28 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id r21-20020a05600c35d500b00407efbc4361sm13391502wmq.9.2023.11.13.02.24.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 02:24:28 -0800 (PST) Message-ID: <804624950aee9112b2ba88dd8f489b91a5392ad3.1699871056.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Mon, 13 Nov 2023 10:24:15 +0000 Subject: [PATCH 13/13] Handled git pipeline errors - z/OS enable Fcc: Sent Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 To: git@vger.kernel.org Cc: Haritha , Haritha D From: Haritha D From: Haritha D This PR has fixes to enable build on z/OS Signed-off-by: Harithamma D --- convert.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/convert.c b/convert.c index 4c034bb714c..c66f5b3ecec 100644 --- a/convert.c +++ b/convert.c @@ -1315,7 +1315,6 @@ static struct attr_check *check; static void get_platform(char** result) { struct utsname uname_info; - *result = NULL; if (uname(&uname_info) < 0) die(_("uname() failed with error '%s' (%d)\n"), @@ -1346,11 +1345,10 @@ void convert_attrs(struct index_state *istate, { struct attr_check_item *ccheck = NULL; struct strbuf platform_working_tree_encoding = STRBUF_INIT; - char* result=NULL; + char* result="Unknown"; get_platform(&result); strbuf_addf(&platform_working_tree_encoding, "%s-working-tree-encoding", result); - if (result != NULL) - free (result); + free (result); if (!check) { check = attr_check_initl("crlf", "ident", "filter",