[Amizilla-cvs] amizilla/xpcom/io nsLocalFileUnix.cpp,1.2,1.3
Brought to you by:
maxlarsson
From: Jeff S. <jsh...@us...> - 2004-10-11 21:16:08
|
Update of /cvsroot/amizilla/amizilla/xpcom/io In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1953 Modified Files: nsLocalFileUnix.cpp Log Message: Call PR equivalents instead of native ones. AmigaOS defines. Index: nsLocalFileUnix.cpp =================================================================== RCS file: /cvsroot/amizilla/amizilla/xpcom/io/nsLocalFileUnix.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** nsLocalFileUnix.cpp 18 Jul 2004 00:32:49 -0000 1.2 --- nsLocalFileUnix.cpp 11 Oct 2004 21:15:55 -0000 1.3 *************** *** 71,74 **** --- 71,75 ---- #include "nsNativeCharsetUtils.h" + #include "prerror.h" // On some platforms file/directory name comparisons need to *************** *** 390,394 **** { *_retval = nsnull; ! return mkdir(path, mode); } --- 391,395 ---- { *_retval = nsnull; ! return PR_MkDir(path, mode); } *************** *** 530,534 **** --- 531,539 ---- --stop; while (--it != stop) { + #ifdef XP_AMIGAOS + if (*it == '/' || *it == ':') { + #else if (*it == '/') { + #endif begin = ++it; return; *************** *** 882,885 **** --- 887,891 ---- } } + return rv; } *************** *** 892,903 **** VALIDATE_STAT_CACHE(); PRBool isSymLink, isDir; ! nsresult rv = IsSymlink(&isSymLink); if (NS_FAILED(rv)) return rv; ! if (!recursive && isSymLink) ! return NSRESULT_FOR_RETURN(unlink(mPath.get())); ! isDir = S_ISDIR(mCachedStat.st_mode); InvalidateCache(); --- 898,912 ---- VALIDATE_STAT_CACHE(); PRBool isSymLink, isDir; ! nsresult rv = IsSymlink(&isSymLink); if (NS_FAILED(rv)) return rv; ! if (!recursive && isSymLink) { ! if (PR_Delete(mPath.get()) == PR_FAILURE) ! return NS_ErrorAccordingToNSPR(); ! } ! ! isDir = S_ISDIR(mCachedStat.st_mode); InvalidateCache(); *************** *** 929,937 **** } ! if (rmdir(mPath.get()) == -1) ! return NSRESULT_FOR_ERRNO(); } else { ! if (unlink(mPath.get()) == -1) ! return NSRESULT_FOR_ERRNO(); } --- 938,947 ---- } ! if (PR_RmDir(mPath.get()) == PR_FAILURE) ! return NS_ErrorAccordingToNSPR(); ! } else { ! if (PR_Delete(mPath.get()) == PR_FAILURE) ! return NS_ErrorAccordingToNSPR(); } *************** *** 1189,1192 **** --- 1199,1207 ---- // find the last significant slash in buffer slashp = strrchr(buffer, '/'); + #ifdef XP_AMIGAOS + if (!slashp) + slashp = strchr(buffer, ':'); + #endif + NS_ASSERTION(slashp, "non-canonical mPath?"); if (!slashp) *************** *** 1223,1227 **** NS_ENSURE_ARG_POINTER(_retval); ! *_retval = (access(mPath.get(), F_OK) == 0); return NS_OK; } --- 1238,1242 ---- NS_ENSURE_ARG_POINTER(_retval); ! *_retval = (PR_Access(mPath.get(), PR_ACCESS_READ_OK) == PR_SUCCESS); return NS_OK; } |