git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Edgar Toernig <froese@gmx.de>
To: Linus Torvalds <torvalds@osdl.org>
Cc: git@vger.kernel.org
Subject: git compatibility patches
Date: Sat, 30 Apr 2005 13:40:20 +0200	[thread overview]
Message-ID: <20050430134020.7fc926ae.froese@gmx.de> (raw)

With these fourc patches and the previous date patch git compiles
and works on my good old gcc2.7/libc5/2.0-kernel system.

The first one: support for pre-1.2 zlib:

--- k/cache.h  (mode:100644)
+++ l/cache.h  (mode:100644)
@@ -17,6 +17,10 @@
 #include SHA1_HEADER
 #include <zlib.h>
 
+#if ZLIB_VERNUM < 0x1200
+#define deflateBound(c,s)  ((s) + (((s) + 7) >> 3) + (((s) + 63) >> 6) + 11)
+#endif
+
 /*
  * Basic data structures for the directory cache
  *




The second one: missing dirent.d_type field

--- k/cache.h  (mode:100644)
+++ l/cache.h  (mode:100644)
@@ -21,6 +21,15 @@
 #define deflateBound(c,s)  ((s) + (((s) + 7) >> 3) + (((s) + 63) >> 6) + 11)
 #endif
 
+#ifdef DT_UNKNOWN
+#define DTYPE(de)	((de)->d_type)
+#else
+#define DT_UNKNOWN	0
+#define DT_DIR		1
+#define DT_REG		2
+#define DTYPE(de)	DT_UNKNOWN
+#endif
+
 /*
  * Basic data structures for the directory cache
  *
--- k/show-files.c  (mode:100644)
+++ l/show-files.c  (mode:100644)
@@ -129,7 +129,7 @@ static void read_directory(const char *p
 			len = strlen(de->d_name);
 			memcpy(fullname + baselen, de->d_name, len+1);
 
-			switch (de->d_type) {
+			switch (DTYPE(de)) {
 			struct stat st;
 			default:
 				continue;



The third one: replace AF_LOCAL with AF_UNIX (there's no AF_LOCAL in POSIX).

--- k/rsh.c  (mode:100644)
+++ l/rsh.c  (mode:100644)
@@ -48,7 +48,7 @@ int setup_connection(int *fd_in, int *fd
 		}
 	}
 	strcpy(posn, " -");
-	if (socketpair(AF_LOCAL, SOCK_STREAM, 0, sv)) {
+	if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv)) {
 		return error("Couldn't create socket");
 	}
 	if (!fork()) {


And the last one: move variable declarations to the start of the function.

--- k/tag.c  (mode:100644)
+++ l/tag.c  (mode:100644)
@@ -26,6 +26,10 @@ int parse_tag(struct tag *item)
         char type[20];
         void *data, *bufptr;
         unsigned long size;
+	int typelen, taglen;
+	unsigned char object[20];
+	const char *type_line, *tag_line, *sig_line;
+
         if (item->object.parsed)
                 return 0;
         item->object.parsed = 1;
@@ -36,10 +40,6 @@ int parse_tag(struct tag *item)
         if (strcmp(type, tag_type))
                 return error("Object %s not a tag",
                              sha1_to_hex(item->object.sha1));
-
-	int typelen, taglen;
-	unsigned char object[20];
-	const char *type_line, *tag_line, *sig_line;
 
 	if (size < 64)
 		return -1;

Ciao, ET.

                 reply	other threads:[~2005-04-30 11:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050430134020.7fc926ae.froese@gmx.de \
    --to=froese@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).