Package: boinc / 7.14.2+dfsg-3

filesys_error_message.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Description: this patch adds an useful error message in case of dir open failure.
--- a/lib/filesys.cpp
+++ b/lib/filesys.cpp
@@ -154,7 +154,12 @@ DIRREF dir_open(const char* p) {
     dirp->handle = INVALID_HANDLE_VALUE;
 #else
     dirp = opendir(p);
-    if (!dirp) return NULL;
+    if (!dirp) {
+        char b[MAXPATHLEN+1];
+        boinc_getcwd(b);
+        fprintf(stderr,"dir_open: Could not open directory '%s' from '%s'.\n",p,b);
+        return NULL;
+    }
 #endif
     return dirp;
 }
@@ -682,7 +687,7 @@ static int boinc_rename_aux(const char*
     //
     int retval = rename(old, newf);
     if (retval) {
-        char buf[MAXPATHLEN+MAXPATHLEN];
+        char buf[MAXPATHLEN+MAXPATHLEN+1+7];
         sprintf(buf, "mv \"%s\" \"%s\"", old, newf);
 #ifdef __APPLE__
         // system() is deprecated in Mac OS 10.10.