From 8644340455a433f4d6e3b31b329479f1e7983f78 Mon Sep 17 00:00:00 2001 From: erik Date: Tue, 23 Jan 2007 21:39:59 +0000 Subject: A couple more return values that need to be checked. --- diff --git a/core/opie-login/passworddialogimpl.cpp b/core/opie-login/passworddialogimpl.cpp index d9132e2..3c1b474 100644 --- a/core/opie-login/passworddialogimpl.cpp +++ b/core/opie-login/passworddialogimpl.cpp @@ -164,7 +164,11 @@ void PasswordDialogImpl::writePassword() { ::fclose( file ); ::endpwent(); - ::rename("/etc/passwd.new","/etc/passwd" ); + if (::rename("/etc/passwd.new","/etc/passwd" ) == -1) + return error( tr("Rename /etc/passwd failed"), + tr("Renaming /etc/passwd.new to /etc/passwd failed." + "Please check your /etc/passed file, your /etc directory " + "or your filesystem.") ); /* should be done now */ #ifdef OPIE_LOGIN_SHADOW_PW diff --git a/noncore/settings/aqpkg/ipkg.cpp b/noncore/settings/aqpkg/ipkg.cpp index dd9e78d..c5c6387 100644 --- a/noncore/settings/aqpkg/ipkg.cpp +++ b/noncore/settings/aqpkg/ipkg.cpp @@ -209,7 +209,7 @@ void Ipkg :: removeStatusEntry() if ( !writeFile.open( IO_WriteOnly ) ) { - tempstr = tr("Couldn't create tempory status file - "); + tempstr = tr("Couldn't create temporary status file - "); tempstr.append( outStatusFile ); emit outputText( tempstr ); return; @@ -270,7 +270,14 @@ void Ipkg :: removeStatusEntry() // Remove old status file and put tmp stats file in its place remove( statusFile ); - rename( outStatusFile, statusFile ); + if (::rename( outStatusFile, statusFile ) == -1) + { + tempstr = tr("Couldn't rename temporary status file - "); + tempstr.append( outStatusFile ); + tempstr.append( tr("to status file - ") ); + tempstr.append( statusFile ); + emit outputText( tempstr ); + } } int Ipkg :: executeIpkgLinkCommand( QStringList *cmd ) -- cgit v0.9.0.2