From a5dee555f918ff4fb89d7a81d68f1299e0ed81b5 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Fri, 13 Aug 2010 18:43:24 +0000 Subject: [PATCH] - lib: prevent crash on startup if slot directories have been deleted. lib/ filesys.cpp svn path=/trunk/boinc/; revision=22226 --- checkin_notes | 6 ++++++ lib/filesys.cpp | 4 ++++ win_build/boinc.sln | 4 ---- win_build/installerv2/BOINC.ism | Bin 212444 -> 212440 bytes win_build/installerv2/BOINCx64.ism | Bin 212428 -> 212428 bytes 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/checkin_notes b/checkin_notes index 780660f797..97ebd44523 100644 --- a/checkin_notes +++ b/checkin_notes @@ -6040,3 +6040,9 @@ Rom 13 Aug 2010 / configure.ac version.h + +Rom 13 Aug 2010 + - lib: prevent crash on startup if slot directories have been deleted. + + lib/ + filesys.cpp diff --git a/lib/filesys.cpp b/lib/filesys.cpp index efc71c5d84..f05733204b 100644 --- a/lib/filesys.cpp +++ b/lib/filesys.cpp @@ -192,11 +192,15 @@ void dir_close(DIRREF dirp) { bool is_dir_empty(const char *p) { char file[256]; + DIRREF dir = dir_open(p); + if (!dir) return true; + if (dir_scan(file, dir, sizeof(file))) { dir_close(dir); return false; } + return true; } diff --git a/win_build/boinc.sln b/win_build/boinc.sln index 0d7cb04b82..63928c68f9 100644 --- a/win_build/boinc.sln +++ b/win_build/boinc.sln @@ -313,9 +313,7 @@ Global {E8F6BD7E-461A-4733-B7D8-37B09A099ED8}.Release|x64.ActiveCfg = Release|x64 {E8F6BD7E-461A-4733-B7D8-37B09A099ED8}.Release|x64.Build.0 = Release|x64 {B950E31B-C075-4F6D-8A2B-25EAE9D46C93}.Debug|Win32.ActiveCfg = Debug|Win32 - {B950E31B-C075-4F6D-8A2B-25EAE9D46C93}.Debug|Win32.Build.0 = Debug|Win32 {B950E31B-C075-4F6D-8A2B-25EAE9D46C93}.Debug|x64.ActiveCfg = Debug|x64 - {B950E31B-C075-4F6D-8A2B-25EAE9D46C93}.Debug|x64.Build.0 = Debug|x64 {B950E31B-C075-4F6D-8A2B-25EAE9D46C93}.EmuDebug|Win32.ActiveCfg = Debug|Win32 {B950E31B-C075-4F6D-8A2B-25EAE9D46C93}.EmuDebug|Win32.Build.0 = Debug|Win32 {B950E31B-C075-4F6D-8A2B-25EAE9D46C93}.EmuDebug|x64.ActiveCfg = Debug|x64 @@ -325,9 +323,7 @@ Global {B950E31B-C075-4F6D-8A2B-25EAE9D46C93}.EmuRelease|x64.ActiveCfg = Release|x64 {B950E31B-C075-4F6D-8A2B-25EAE9D46C93}.EmuRelease|x64.Build.0 = Release|x64 {B950E31B-C075-4F6D-8A2B-25EAE9D46C93}.Release|Win32.ActiveCfg = Release|Win32 - {B950E31B-C075-4F6D-8A2B-25EAE9D46C93}.Release|Win32.Build.0 = Release|Win32 {B950E31B-C075-4F6D-8A2B-25EAE9D46C93}.Release|x64.ActiveCfg = Release|x64 - {B950E31B-C075-4F6D-8A2B-25EAE9D46C93}.Release|x64.Build.0 = Release|x64 {4A2C5963-6A8D-4DA1-A312-C3D749B2EA81}.Debug|Win32.ActiveCfg = Debug|Win32 {4A2C5963-6A8D-4DA1-A312-C3D749B2EA81}.Debug|Win32.Build.0 = Debug|Win32 {4A2C5963-6A8D-4DA1-A312-C3D749B2EA81}.Debug|x64.ActiveCfg = Debug|x64 diff --git a/win_build/installerv2/BOINC.ism b/win_build/installerv2/BOINC.ism index e793743216bd2828afd66f2d18a68da438de44c5..bb8a947d6cf058a8de7c6598bb8ab73e4e7598bc 100644 GIT binary patch delta 164 zcmccfo9D)Fo((xHY!mK(FJQFZT*T7G$9SXpr_lDFLX5&2IKS}ma|m+qa-82TdYI8& zn(=FU>^;WqvG_N5z>+!0!c5Q5P|u{=($&n^$ko+c z*UiA#P1nT8$Vu1I)W}@d#LUIn*wxs?%+1oMHYqwL3`Lv{;29x``;PWbLCXq{&P(yV7oW z8J_fDgm|zjL2?vnU{8?2L=nL%=)r@i7xARXQ1Q?SbF$mVcl*A!)dEvp^2GnO~SZ=1vx*@2{mKe{hiW|#O+lqg)(`u(GZ1|Xm=N~{qx@_?V`gb zaPp#rLrh6#>P?2@nOxg)HOousWH}i((CSx9|K=SF z@F~5!+rVY??p2_2eLZ0?+N&|`A#E*`r{^()m*kzOx+th8;=pcL`yXA}8=96lsjYV1 zz-gG@eQ{|&XgV}im{vT$!p7mBPu*l_1qh;@C_E*u9RQCh%49OBPwb#T&_OWtAS^6q zd0tNfTD?38oa)94IHJ1W!@VS&0dKA7EW5ySm9}Q~b2^xpP5rm~~i9M$~AXK=jO&P-$;+udU0BXt{&olZV7@%Y^qh4j<1o5))lONSe z?2I7kJfzjX%P^p9`u3360(|X7?GV%HoY8MVnxNZo7)F@k=6I~X{4WM@=tXi-Pu|tpT*T5Rxmi^1HS=WcFz(6RVO)!pOg4*#y=IX~frtSe_zt2Q=wG%_}Fw$wFsbTZa8F)(q} zb#!uZ(ls$Lb9FLvG%_%7Gp*e$-TIVglAP$KNppA@*(T4O_n%R1^W6E#Op~|oRoHC0 z=rs4FO`?m|v1}II^jdn-CDBFafXquk<|olb?|{rt_hqG%@-y?2;~{p(muKdshPR{f~ zdq&CW`%M`+w<}pO-r(Qn#mH63mCnr1A;`hYq0YQr#cNZu`Pi W&$PYu8&kV8GXn#|c77}7z03fR-IPrL