This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] hurd: Fix F_*LK* fcntl with __USE_FILE_OFFSET64
- From: Roland McGrath <roland at hack dot frob dot com>
- To: Samuel Thibault <samuel dot thibault at gnu dot org>
- Cc: libc-alpha at sourceware dot org, bug-hurd at gnu dot org
- Date: Sat, 7 Feb 2015 18:20:31 -0800 (PST)
- Subject: Re: [PATCH] hurd: Fix F_*LK* fcntl with __USE_FILE_OFFSET64
- Authentication-results: sourceware.org; auth=none
- References: <20150207220716 dot GW3023 at type dot youpi dot perso dot aquilenet dot fr>
> +# define F_GETLK 7 /* Get record locking info. */
> +# define F_SETLK 8 /* Set record locking info (non-blocking). */
> +# define F_SETLKW 9 /* Set record locking info (blocking). */
> +#endif
> +#define F_GETLK64 10 /* Get record locking info. */
> +#define F_SETLK64 11 /* Set record locking info (non-blocking). */
> +#define F_SETLKW64 12 /* Set record locking info (blocking). */
Do these values match up with any other system's values?
i.e., if most of our values already match Linux or some BSD subset,
then for new arbitrary values, we pick the ones that match the same thing.
> +{
> + int cmd;
> +
> + switch (type)
> + {
> + case F_RDLCK: cmd |= LOCK_SH; break;
> + case F_WRLCK: cmd |= LOCK_EX; break;
Uses CMD uninitialized. The equivalent to the original code
in __fcntl is to initialize CMD to zero here.
I would have thought the compiler would catch that. Have you tested this
patch on current trunk libc? Are you using --disable-werror for some reason?
If you are, then let's work on resolving those outstanding warnings ASAP.
Thanks,
Roland