[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] make libdiskfs handle _PC_PATH_MAX
From: |
Thomas Schwinge |
Subject: |
Re: [PATCH] make libdiskfs handle _PC_PATH_MAX |
Date: |
Wed, 19 Oct 2011 22:13:35 +0200 |
User-agent: |
Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/23.3.1 (i486-pc-linux-gnu) |
Hi!
On Wed, 19 Oct 2011 00:09:32 +0200, Pino Toscano <toscano.pino@tiscali.it>
wrote:
> currently, querying (f)pathconf() for _PC_PATH_MAX return -1 and sets
> errno = EINVAL. At least to my reading of pathconf() in POSIX, when a
> variable has no limit pathconf() for it should return -1 and not change
> errno. For example:
> $ getconf PATH_MAX .
> getconf: pathconf: .: Invalid argument
> fpathconf() just queries the translator which handles the specified
> path, so the fix I thought about is to make the io_pathconf() reply in
> libdiskfs handle _PC_PATH_MAX too among the other cases of "set -1 and
> return 0".
>
> With the applied path, I correctly get:
> $ getconf PATH_MAX .
> undefined
Thanks for the patch!
> * libdiskfs/io-pathconf.c (diskfs_S_io_pathconf): Handle _PC_PATH_MAX
> too.
> ---
> libdiskfs/io-pathconf.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/libdiskfs/io-pathconf.c b/libdiskfs/io-pathconf.c
> index b851f9b..38e277c 100644
> --- a/libdiskfs/io-pathconf.c
> +++ b/libdiskfs/io-pathconf.c
> @@ -41,6 +41,7 @@ diskfs_S_io_pathconf (struct protid *cred,
> case _PC_PIPE_BUF:
> case _PC_VDISABLE:
> case _PC_SOCK_MAXBUF:
> + case _PC_PATH_MAX:
> *value = -1;
> break;
>
Just an oversight, or is there a reason to not changing
libnetfs/io-pathconf.c and term/users.c, too?
$ showtrans /media/kepler-data
/hurd/nfs kepler.schwinge.homeip.net:/media/data
$ getconf PATH_MAX /media/kepler-data/
getconf: pathconf: /media/kepler-data/: Invalid argument
Grüße,
Thomas
pgp3HsNMsRT8N.pgp
Description: PGP signature