From 601b8f05daeb65e6b220147ac9694d02fde83625 Mon Sep 17 00:00:00 2001 From: Robert Strong Date: Wed, 11 Nov 2009 01:02:38 -0800 Subject: [PATCH] Bug 527845 (WinCE only) - App update can't deal with read-only files. r=vlad --- toolkit/mozapps/update/src/updater/updater_wince.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/toolkit/mozapps/update/src/updater/updater_wince.cpp b/toolkit/mozapps/update/src/updater/updater_wince.cpp index ddc6162d0f0c..20ec26c32d62 100644 --- a/toolkit/mozapps/update/src/updater/updater_wince.cpp +++ b/toolkit/mozapps/update/src/updater/updater_wince.cpp @@ -47,12 +47,14 @@ int errno = 0; int chmod(const char* path, unsigned int mode) { - return 0; + WCHAR wpath[MAX_PATH]; + MultiByteToWideChar(CP_ACP, 0, path, -1, wpath, MAX_PATH); + return _wchmod(wpath, mode); } int _wchmod(const WCHAR* path, unsigned int mode) { - return 0; + return SetFileAttributesW(path, FILE_ATTRIBUTE_NORMAL) ? 0 : 1; } int fstat(FILE* handle, struct stat* buff)