From 369aa0eb3d696512701c45665b01f1f09fafdf54 Mon Sep 17 00:00:00 2001 From: Brad Lassey Date: Tue, 21 Jul 2009 03:25:37 -0400 Subject: [PATCH] bug 504917 - fix warnings in updater.cpp r=bsmedberg --- toolkit/mozapps/update/src/updater/updater.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/toolkit/mozapps/update/src/updater/updater.cpp b/toolkit/mozapps/update/src/updater/updater.cpp index e189499cc5f5..b41bff278dcc 100644 --- a/toolkit/mozapps/update/src/updater/updater.cpp +++ b/toolkit/mozapps/update/src/updater/updater.cpp @@ -190,6 +190,10 @@ public: operator FILE*() { return mFile; } + + FILE* get() { + return mFile; + } private: FILE* mFile; @@ -409,7 +413,7 @@ static int ensure_remove(const char *path) return rv; } -static FILE* ensure_open(const char *path, char* flags, int options) +static FILE* ensure_open(const char *path, const char* flags, unsigned int options) { ensure_write_permissions(path); FILE* f = fopen(path, flags); @@ -459,7 +463,7 @@ static int copy_file(const char *spath, const char *dpath) AutoFile sfile = fopen(spath, "rb"); if (sfile == NULL || fstat(fileno(sfile), &ss)) { - LOG(("copy_file: failed to open or stat: %p,%s,%d\n", sfile, spath, errno)); + LOG(("copy_file: failed to open or stat: %p,%s,%d\n", sfile.get(), spath, errno)); return READ_ERROR; } @@ -1168,11 +1172,12 @@ LaunchWinPostProcess(const WCHAR *appExe) static void LaunchCallbackApp(const NS_tchar *workingDir, int argc, NS_tchar **argv) { - putenv("NO_EM_RESTART="); - putenv("MOZ_LAUNCHED_CHILD=1"); + putenv(const_cast("NO_EM_RESTART=")); + putenv(const_cast("MOZ_LAUNCHED_CHILD=1")); // Run from the specified working directory (see bug 312360). - NS_tchdir(workingDir); + if(NS_tchdir(workingDir) != 0) + LOG(("Warning: chdir failed")); #if defined(USE_EXECV) execv(argv[0], argv);