git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Riesen <raa.lkml@gmail.com>
To: Git Mailing List <git@vger.kernel.org>
Cc: Johannes Sixt <j.sixt@viscovery.net>, Jeff King <peff@peff.net>,
	layer <layer@known.net>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Junio C Hamano <gitster@pobox.com>
Subject: [PATCH] Define a version of lstat(2) with posix semantics
Date: Thu, 19 Mar 2009 11:27:12 +0100	[thread overview]
Message-ID: <81b0412b0903190327l7745bf01i479fb84fae777af0@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 972 bytes --]

So that Cygwin port can continue work around its supporting
library and get access to its faked file attributes.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---

2009/3/18 Junio C Hamano <gitster@pobox.com>:
> Yuck; that's a bit too ugly for generic code.  Will there be other places
> that this needs to be used?  If so, we'd probably need to encourage its
> use where appropriate, which is even uglier but we cannot avoid it...

You are damn right! I suggest providing posix_lstat, which has the posix
semantics regarding x-bit in st_mode. Maybe even posix_stat is need, too.

There are other places which went broken recently in this regard (lstat
cache patches?). Some will have to use this posix_lstat (the
copy_templates_1), the others have to get a careful core.filemode
handling (like check_remove in diff-lib.c, which isn't just about
removed files).

 git-compat-util.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

[-- Attachment #2: 0001-Define-a-version-of-lstat-2-with-posix-semantics.diff --]
[-- Type: application/octet-stream, Size: 1068 bytes --]

From b0e3710e7e60d8f81bf252ff9987e17ece4a3be3 Mon Sep 17 00:00:00 2001
From: Alex Riesen <raa.lkml@gmail.com>
Date: Thu, 19 Mar 2009 11:17:01 +0100
Subject: [PATCH] Define a version of lstat(2) with posix semantics

So that Cygwin port can continue work around its supporting
library and get access to its faked file attributes.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
 git-compat-util.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/git-compat-util.h b/git-compat-util.h
index 1906253..2401f84 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -85,11 +85,16 @@
 #undef _XOPEN_SOURCE
 #include <grp.h>
 #define _XOPEN_SOURCE 600
+static inline int posix_lstat(const char *file_name, struct stat *buf)
+{
+	return lstat(file_name, buf);
+}
 #include "compat/cygwin.h"
 #else
 #undef _ALL_SOURCE /* AIX 5.3L defines a struct list with _ALL_SOURCE. */
 #include <grp.h>
 #define _ALL_SOURCE 1
+#define posix_lstat lstat
 #endif
 #else 	/* __MINGW32__ */
 /* pull in Windows compatibility stuff */
-- 
1.6.2.142.gaf8db


             reply	other threads:[~2009-03-19 10:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-19 10:27 Alex Riesen [this message]
2009-03-19 10:57 ` [PATCH] Define a version of lstat(2) with posix semantics Johannes Schindelin
2009-03-19 21:40   ` Alex Riesen
2009-03-19 21:43     ` [PATCH] git clone needs to know executability of template files Alex Riesen
2009-03-19 23:30     ` [PATCH] Define a version of lstat(2) with posix semantics Johannes Schindelin
2009-03-20  8:30       ` Alex Riesen
2009-03-20  9:17         ` Johannes Schindelin
2009-03-20 13:39           ` Alex Riesen
2009-03-20 13:49             ` Rogan Dawes
2009-03-20 14:17               ` Alex Riesen
2009-03-20 13:52             ` Johannes Schindelin
2009-03-20 14:20               ` Alex Riesen
2009-03-19 22:08   ` Junio C Hamano

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

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

  git send-email \
    --in-reply-to=81b0412b0903190327l7745bf01i479fb84fae777af0@mail.gmail.com \
    --to=raa.lkml@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j.sixt@viscovery.net \
    --cc=layer@known.net \
    --cc=peff@peff.net \
    /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.
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 NNTP newsgroup(s).