bug 504917 - fix warnings in updater.cpp r=bsmedberg

This commit is contained in:
Brad Lassey 2009-07-21 03:25:37 -04:00
Родитель 802ab6f06d
Коммит 369aa0eb3d
1 изменённых файлов: 10 добавлений и 5 удалений

Просмотреть файл

@ -190,6 +190,10 @@ public:
operator FILE*() { operator FILE*() {
return mFile; return mFile;
} }
FILE* get() {
return mFile;
}
private: private:
FILE* mFile; FILE* mFile;
@ -409,7 +413,7 @@ static int ensure_remove(const char *path)
return rv; 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); ensure_write_permissions(path);
FILE* f = fopen(path, flags); FILE* f = fopen(path, flags);
@ -459,7 +463,7 @@ static int copy_file(const char *spath, const char *dpath)
AutoFile sfile = fopen(spath, "rb"); AutoFile sfile = fopen(spath, "rb");
if (sfile == NULL || fstat(fileno(sfile), &ss)) { 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; return READ_ERROR;
} }
@ -1168,11 +1172,12 @@ LaunchWinPostProcess(const WCHAR *appExe)
static void static void
LaunchCallbackApp(const NS_tchar *workingDir, int argc, NS_tchar **argv) LaunchCallbackApp(const NS_tchar *workingDir, int argc, NS_tchar **argv)
{ {
putenv("NO_EM_RESTART="); putenv(const_cast<char*>("NO_EM_RESTART="));
putenv("MOZ_LAUNCHED_CHILD=1"); putenv(const_cast<char*>("MOZ_LAUNCHED_CHILD=1"));
// Run from the specified working directory (see bug 312360). // 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) #if defined(USE_EXECV)
execv(argv[0], argv); execv(argv[0], argv);