git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Problem adding a symlinkg

From
Alex Riesen <raa.lkml@gmail.com>
Date
Feb 21, 2010, 22:20 UTC
Message-ID
<81b0412b1002211420k7bc73e4aub84ed6829d4a1acd@mail.gmail.com>
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.
Previous: Arnaud Bailly
Message 4 of 4 in “Problem adding a symlinkg”
  1. Arnaud BaillyFeb 11, 2010
  2. Alex RiesenFeb 11, 2010
  3. Arnaud BaillyFeb 20, 2010
  4. Alex RiesenFeb 21, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.