git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Riesen <raa.lkml@gmail.com>
To: Arnaud Bailly <abailly@oqube.com>
Cc: git@vger.kernel.org,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Junio C Hamano <gitster@pobox.com>
Subject: Re: Problem adding a symlinkg
Date: Sun, 21 Feb 2010 23:20:29 +0100	[thread overview]
Message-ID: <81b0412b1002211420k7bc73e4aub84ed6829d4a1acd@mail.gmail.com> (raw)
In-Reply-To: <854olcqlim.fsf@oqube.com>

On Sat, Feb 20, 2010 at 10:55, Arnaud Bailly <abailly@oqube.com> wrote:
> readlink("pb-util/protoc/Linux-x86-2.6.28/lib/libprotobuf-lite.so", "libprotobuf-lite.so.5.0.0"..., 59) = 25

The return value (25, positive) is no error. It is the length of the
symlink data.
This looks like an old Git (59 as buffer size, more recent version
should have used
56 as returned by stat earlier).

> lstat64("pb-util/protoc/Linux-x86-2.6.28/lib/libprotobuf-lite.so", {st_mode=S_IFLNK|0700, st_size=58, ...}) = 0
> write(2, "error: readlink(\"pb-ut"..., 104error: readlink("pb-util/protoc/Linux-x86-2.6.28/lib/libprotobuf-lite.so"): Invalid argument
> ) = 104

This looks like a bug in the version of Git you're using. It must be
fixed by now (at least
in 1.6.2, commit b760d3aa "Make 'index_path()' use 'strbuf_readlink()'").

I don't know why your lstat returns size for a symlink which is
different from what readlink returns,
but this is why it fails: the code that you seem to be using assumed
that must be the case.
Newer code just does not care and trusts the result of readlink.

Upgrade your Git, it is worth the time anyway.

      reply	other threads:[~2010-02-21 22:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-11  6:17 Problem adding a symlinkg Arnaud Bailly
2010-02-11 12:01 ` Alex Riesen
2010-02-20  9:55   ` Arnaud Bailly
2010-02-21 22:20     ` Alex Riesen [this message]

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=81b0412b1002211420k7bc73e4aub84ed6829d4a1acd@mail.gmail.com \
    --to=raa.lkml@gmail.com \
    --cc=abailly@oqube.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=torvalds@linux-foundation.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.
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).