From: Petr Baudis Date: Thu, 28 Apr 2005 01:05:23 GMT Subject: Re: git add / update-cache --add fails. Message-ID: <20050428010523.GB3422@pasky.ji.cz> In-Reply-To: <20050427180143.0447ceaa.pj@sgi.com> Dear diary, on Thu, Apr 28, 2005 at 03:01:43AM CEST, I got a letter where Paul Jackson told me that... > Petr wrote: > > fd = open(path, O_RDONLY); > > if (fd < 0) { > > + fprintf(stderr, "update-cache Error: %s\n", strerror(errno)); > > It's usually a good idea to indicate which system call you were > attempting in such error messages, and if handy, the key argument. > Just the errno might not mean much: > > > + fprintf(stderr, "update-cache open(%s) failed: %s\n", path, strerror(errno)); Sorry for being unclear, I meant that I did an analogous change in my tree before; it is actually a little different: if (errno == ENOENT) { if (allow_remove) return remove_file_from_cache(path); } return error("open(\"%s\"): %s", path, strerror(errno)); -- Petr "Pasky" Baudis Stuff: http://pasky.or.cz/ C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor