Fixed soft link bug.

svn path=/trunk/boinc/; revision=116
This commit is contained in:
Eric Heien 2002-06-19 18:45:43 +00:00
parent d55b22224b
commit b963d03030
1 changed files with 6 additions and 2 deletions

View File

@ -24,13 +24,14 @@
#ifdef WIN32 #ifdef WIN32
#include <io.h> #include <io.h>
#include <sys/stat.h> #include <sys/stat.h>
#include "windows_cpp.h"
#else #else
#include <unistd.h> #include <unistd.h>
#endif #endif
#include <fcntl.h> #include <fcntl.h>
#include <sys/types.h> #include <sys/types.h>
#include "../sched/parse.h" #include "parse.h"
#include "api.h" #include "api.h"
int MFILE::open(char* path, char* mode) { int MFILE::open(char* path, char* mode) {
@ -235,7 +236,10 @@ int boinc_resolve_link(char *file_name, char *resolved_name)
// Open the file and load the first line // Open the file and load the first line
fp = fopen( file_name, "r" ); fp = fopen( file_name, "r" );
if (!fp) return -1; if (!fp) {
strcpy( resolved_name, file_name );
return -1;
}
rewind( fp ); rewind( fp );
fgets(buf, 512, fp); fgets(buf, 512, fp);
fclose( fp ); fclose( fp );