equal
deleted
inserted
replaced
1 // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 1998-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
161 TInt r=file.Open(aFs,aName,EFileShareExclusive|EFileWrite|EFileWriteDirectIO); |
161 TInt r=file.Open(aFs,aName,EFileShareExclusive|EFileWrite|EFileWriteDirectIO); |
162 switch (r) |
162 switch (r) |
163 { |
163 { |
164 case KErrNone: |
164 case KErrNone: |
165 { |
165 { |
166 TInt size; |
166 TInt size = -1; |
167 if (file.Size(size)==KErrNone && size!=0) |
167 // coverity[negative_returns] |
|
168 if (file.Size(size)==KErrNone && size>0) |
168 { |
169 { |
169 CFileStore* store=NULL; |
170 CFileStore* store=NULL; |
170 TRAP(r,store=CPermanentFileStore::FromL(file)); |
171 TRAP(r,store=CPermanentFileStore::FromL(file)); |
171 if (r==KErrNotSupported||r==KErrEof) |
172 if (r==KErrNotSupported||r==KErrEof) |
172 r=KErrCorrupt; // treat a bad store file as corrupt |
173 r=KErrCorrupt; // treat a bad store file as corrupt |