Robert is correct that the fields should be tested as bitmasks.
Only O_RDONLY and O_WRONLY is well defined for a storeioobject within
Squid. Was probably a bad idea to mirror the UNIX file mode field.
The field is mostly private to each store-io implementation.
Regards
Henrik
> >The correct fix is:
> >
> >if (sio->mode & O_WRONLY)
> >else if (sio->mode & O_RDONLY).
> >
> >In storeAufsOpen, the sio->mode should be O_RDONLY | O_BINARY.
> >
> >Rob
>
> I think that the meaning and use of sio->mode are not clear:
>
> - in store_io_ufs.c is set to O_RDONLY or O_WRONLY | O_CREAT | O_TRUNC |
> O_BINARY, but never tested
> - in store_io_diskd.c is set to O_RDONLY or O_WRONLY | O_CREAT | O_TRUNC
> and tested only as O_RDONLY, so there is a logical bug, but things works
> - in store_io_coss.c is set to O_WRONLY or O_RDONLY and tested only as O_WRONLY
> - in store_io_aufs.c is set to O_RDONLY or O_WRONLY | O_BINARY and tested
> as O_RDONLY or O_WRONLY, and this is wrong without doubt
>
> It seems to be used only simply for mark read or write mode of cache files.
>
> So, my question are:
>
> 1) what means exactly sio->mode ?
> 2) Is correct use for it the O_* values ?
>
> Regards
>
> Guido
>
>
>
> -
> =======================================================
> Serassio Guido
> Via Albenga, 11/4 10134 - Torino - ITALY
> E-mail: guido.serassio@serassio.it
> WWW: http://www.serassio.it
>
Received on Sun Jul 28 2002 - 15:24:21 MDT
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:15:54 MST