[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: error and program_name

From: Paul Eggert
Subject: Re: error and program_name
Date: Wed, 22 Dec 2010 18:12:15 -0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20101208 Thunderbird/3.1.7

On 12/22/2010 03:32 PM, Bruno Haible wrote:
> For example, if save_cwd called
>   currdir_fd = open (".");
> then on a platform that supports fchdir() natively [not gnulib's
> emulation], a failure to do  fchdir (currdir_fd)  is of type (a).
> It can only occur if some other part of the program did side
> effects on currdir_fd.

Hmm, well, no, the fchdir could also fail if the directory is
on a remote file system and the network is down.  Or
if there is an I/O error (errno == EIO).  Or if search
permission is absent from the directory, assuming the
usual case where the directory was opened with O_RDONLY.
There are probably other reasons.

One workaround would be to wrap every system call
that resolves file names, so that all of these system calls
fail if given a relative file name after the fchdir failed.
But that sounds pretty drastic.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]