Re: [Squid-cvs] nt-2_5 squid/src/fs/aufs store_dir_aufs.c,1.23.6.1.4.15,1.23.6.1.4.16

From: Serassio Guido <guido.serassio@dont-contact.us>
Date: Fri, 20 May 2005 15:46:17 +0200

Hi Henrik,

At 13.14 20/05/2005, Henrik Nordstrom wrote:

>On Fri, 20 May 2005, Guido Serassio wrote:
>
>>--- store_dir_aufs.c 27 Mar 2005 07:51:24 -0000 1.23.6.1.4.15
>>+++ store_dir_aufs.c 20 May 2005 08:41:51 -0000 1.23.6.1.4.16
>>@@ -1175,7 +1175,7 @@
>> debug(50, 0) ("%s: %s\n", swaplog_path, xstrerror());
>> fatal("Failed to open swap log for reading");
>> }
>>-#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)
>>+#if defined(_SQUID_CYGWIN_)
>> setmode(fileno(fp), O_BINARY);
>>#endif
>> memset(&clean_sb, '\0', sizeof(struct stat));
>
>Are you sure about this? The file is binary..

This is exactly the current code in 2.5 STABLE. I have changed the "#if
defined" simply to remove a not needed Windows change in the aufs code
(aufs is not used on Windows, awin32 is used instead).

>Additionally isn't it better to fopen the file binary to begin with?
>
>from
> fp = fopen(swaplog_path, "r");
>to
> fp = fopen(swaplog_path, "rb");
>
>
>the b flag is accepted by all systems I know of, including UNIX (ignored
>there..).

Sure, in the nt branches, ufs and awin32 disk modules already open files in
"rb" mode, without any setmode().

This code is unchanged from many time. I have never changed this because
I'm not sure about any implication on existing disk cache on any other
system than Windows.

There was an old thread on squid-dev about a similar question:
http://www.squid-cache.org/mail-archive/squid-dev/200205/0107.html

Regards

Guido

-
========================================================
Guido Serassio
Acme Consulting S.r.l. - Microsoft Certified Partner
Via Lucia Savarino, 1 10098 - Rivoli (TO) - ITALY
Tel. : +39.011.9530135 Fax. : +39.011.9781115
Email: guido.serassio@acmeconsulting.it
WWW: http://www.acmeconsulting.it/
Received on Fri May 20 2005 - 07:46:24 MDT

This archive was generated by hypermail pre-2.1.9 : Tue May 31 2005 - 12:00:03 MDT