Skip to content

Commit

Permalink
- A bunch of tweaks from Steffen Moller, e.g. using MAXPATHLEN
Browse files Browse the repository at this point in the history
svn path=/trunk/boinc/; revision=26133
  • Loading branch information
davidpanderson committed Sep 21, 2012
1 parent 7cc750e commit aa289f0
Show file tree
Hide file tree
Showing 23 changed files with 235 additions and 582 deletions.
6 changes: 3 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ endif

if ENABLE_MANAGER
CLIENTGUI_SUBDIRS = clientgui locale
#if BUILD_X11_SCREENSAVER
# CLIENTGUI_SUBDIRS += clientscr
#endif
if BUILD_X11_SCREENSAVER
CLIENTGUI_SUBDIRS += clientscr
endif
endif

# ORDER MATTERS below. One must build dependencies FIRST, then things
Expand Down
10 changes: 5 additions & 5 deletions api/graphics2_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

#ifdef __EMX__
static key_t get_shmem_name(const char* prog_name) {
char cwd[256], path[256];
char cwd[MAXPATHLEN], path[MAXPATHLEN];
boinc_getcwd(cwd);
sprintf(path, "%s/init_data.xml", cwd);
return ftok(path, 2);
Expand All @@ -54,7 +54,7 @@ static void get_shmem_name(const char* prog_name, char* shmem_name) {
void* boinc_graphics_make_shmem(const char* prog_name, int size) {
#ifdef _WIN32
HANDLE shmem_handle;
char shmem_name[256];
char shmem_name[MAXPATHLEN];
void* p;
get_shmem_name(prog_name, shmem_name);
shmem_handle = create_shmem(shmem_name, size, &p);
Expand All @@ -67,7 +67,7 @@ void* boinc_graphics_make_shmem(const char* prog_name, int size) {
int retval = create_shmem(key, size, 0, &p);
#else
// V6 Unix/Linux/Mac applications always use mmap() shared memory for graphics communication
char shmem_name[256];
char shmem_name[MAXPATHLEN];
get_shmem_name(prog_name, shmem_name);
int retval = create_shmem_mmap(shmem_name, size, &p);
// Graphics app may be run by a different user & group than worker app
Expand All @@ -82,7 +82,7 @@ void* boinc_graphics_make_shmem(const char* prog_name, int size) {
#ifdef _WIN32
void* boinc_graphics_get_shmem(const char* prog_name) {
HANDLE shmem_handle;
char shmem_name[256];
char shmem_name[MAXPATHLEN];
void* p;
get_shmem_name(prog_name, shmem_name);
shmem_handle = attach_shmem(shmem_name, &p);
Expand All @@ -100,7 +100,7 @@ void* boinc_graphics_get_shmem(const char* prog_name) {
retval = attach_shmem(key, &p);
#else
// V6 Unix/Linux/Mac applications always use mmap() shared memory for graphics communication
char shmem_name[256];
char shmem_name[MAXPATHLEN];
get_shmem_name(prog_name, shmem_name);
retval = attach_shmem_mmap(shmem_name, &p);
#endif
Expand Down
15 changes: 8 additions & 7 deletions api/gutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,10 @@ tImageJPG *LoadJPG(const char *filename) {

int TEXTURE_DESC::CreateTextureJPG(const char* strFileName) {
if(!strFileName) return -1;
tImageJPG *pImage = LoadJPG(strFileName); // Load the image and store the data

// Load the image and store the data
//
tImageJPG *pImage = LoadJPG(strFileName);
if(pImage == NULL) return -1;
glPixelStorei(GL_UNPACK_ALIGNMENT,1);
glGenTextures(1, (GLuint*)&id);
Expand All @@ -698,12 +701,10 @@ int TEXTURE_DESC::CreateTextureJPG(const char* strFileName) {
xsize = pImage->sizeX;
ysize = pImage->sizeY;

if (pImage) {
if (pImage->data) {
free(pImage->data);
}
free(pImage);
}
if (pImage->data) {
free(pImage->data);
}
free(pImage);
return 0;
}

Expand Down
5 changes: 5 additions & 0 deletions checkin_notes
Original file line number Diff line number Diff line change
Expand Up @@ -6015,3 +6015,8 @@ David 20 Sept 2012
tools/
backend_lib.cpp,h
cancel_jobs.cpp

David 20 Sept 2012
- A bunch of tweaks from Steffen Moller, e.g. using MAXPATHLEN

various files
2 changes: 1 addition & 1 deletion client/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ void ACTIVE_TASK_SET::report_overdue() {
//
int ACTIVE_TASK::handle_upload_files() {
std::string filename;
char buf[256], path[MAXPATHLEN];
char buf[MAXPATHLEN], path[MAXPATHLEN];
int retval;

DirScanner dirscan(slot_dir);
Expand Down
2 changes: 1 addition & 1 deletion client/app.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ struct ACTIVE_TASK {
double bytes_received;
char slot_dir[256];
// directory where process runs (relative)
char slot_path[512];
char slot_path[MAXPATHLEN];
// same, absolute
// This is used only to run graphics apps
// (that way don't have to worry about top-level dirs
Expand Down
9 changes: 5 additions & 4 deletions client/check_security.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@
bool IsUserInGroupBM();
#endif

static int CheckNestedDirectories(char * basepath, int depth,
int use_sandbox, int isManager,
char * path_to_error
);
static int CheckNestedDirectories(
char * basepath, int depth,
int use_sandbox, int isManager,
cont char * path_to_error
);

#if (! defined(__WXMAC__) && ! defined(_MAC_INSTALLER))
static char * PersistentFGets(char *buf, size_t buflen, FILE *f);
Expand Down
2 changes: 1 addition & 1 deletion client/cs_statefile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ int CLIENT_STATE::parse_app_info(PROJECT* p, FILE* in) {
_("File referenced in app_info.xml does not exist: ")
);
strcat(buf, fip->name);
msg_printf(p, MSG_USER_ALERT, buf);
msg_printf(p, MSG_USER_ALERT, "%s", buf);
delete fip;
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion client/sandbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ int delete_project_owned_file(const char* path, bool retry) {
// If an error occurs, delete as much as possible.
//
int client_clean_out_dir(const char* dirpath, const char* reason) {
char filename[256], path[MAXPATHLEN];
char filename[MAXPATHLEN], path[MAXPATHLEN];
int retval, final_retval = 0;
DIRREF dirp;

Expand Down
Loading

0 comments on commit aa289f0

Please sign in to comment.