On Sat, Feb 20, 2010 at 10:55, Arnaud Bailly <abailly@xxxxxxxxx> 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. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html