Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(471)

Side by Side Diff: third_party/sqlite/mac_time_machine.patch

Issue 14651031: Convert degenerate memcmp() to strncmp() in SQLite TimeMachine patch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/sqlite/amalgamation/sqlite3.c ('k') | third_party/sqlite/src/src/pager.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 Index: src/sqliteInt.h 1 Index: src/sqliteInt.h
2 =================================================================== 2 ===================================================================
3 --- src/sqliteInt.h (revision 87306) 3 --- src/sqliteInt.h (revision 87306)
4 +++ src/sqliteInt.h (working copy) 4 +++ src/sqliteInt.h (working copy)
5 @@ -2522,6 +2522,16 @@ 5 @@ -2522,6 +2522,16 @@
6 #endif 6 #endif
7 7
8 /* 8 /*
9 +** The CoreServices.h and CoreFoundation.h headers are needed for excluding a 9 +** The CoreServices.h and CoreFoundation.h headers are needed for excluding a
10 +** -journal file from Time Machine backups when its associated database has 10 +** -journal file from Time Machine backups when its associated database has
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 @@ -5189,6 +5203,24 @@ 48 @@ -5189,6 +5203,24 @@
49 #else 49 #else
50 rc = sqlite3OsOpen(pVfs, pPager->zJournal, pPager->jfd, flags, 0); 50 rc = sqlite3OsOpen(pVfs, pPager->zJournal, pPager->jfd, flags, 0);
51 #endif 51 #endif
52 +#if defined(__APPLE__) 52 +#if defined(__APPLE__)
53 + /* Set the TimeMachine exclusion metadata for the journal if it has 53 + /* Set the TimeMachine exclusion metadata for the journal if it has
54 + ** been set for the database. Only do this for unix-type vfs 54 + ** been set for the database. Only do this for unix-type vfs
55 + ** implementations. */ 55 + ** implementations. */
56 + if( rc==SQLITE_OK && pPager->zFilename!=NULL 56 + if( rc==SQLITE_OK && pPager->zFilename!=NULL
57 + && strlen(pPager->zFilename)>0 57 + && strlen(pPager->zFilename)>0
58 + && memcmp(pVfs->zName, "unix", 4)==0 58 + && strncmp(pVfs->zName, "unix", 4)==0
59 + && ( pVfs->zName[4]=='-' || pVfs->zName[4]=='\0' ) ){ 59 + && ( pVfs->zName[4]=='-' || pVfs->zName[4]=='\0' ) ){
60 + CFURLRef database = create_cfurl_from_cstring(pPager->zFilename); 60 + CFURLRef database = create_cfurl_from_cstring(pPager->zFilename);
61 + if( CSBackupIsItemExcluded(database, NULL) ){ 61 + if( CSBackupIsItemExcluded(database, NULL) ){
62 + CFURLRef journal = create_cfurl_from_cstring(pPager->zJournal); 62 + CFURLRef journal = create_cfurl_from_cstring(pPager->zJournal);
63 + /* Ignore errors from the following exclusion call. */ 63 + /* Ignore errors from the following exclusion call. */
64 + CSBackupSetItemExcluded(journal, TRUE, FALSE); 64 + CSBackupSetItemExcluded(journal, TRUE, FALSE);
65 + CFRelease(journal); 65 + CFRelease(journal);
66 + } 66 + }
67 + CFRelease(database); 67 + CFRelease(database);
68 + } 68 + }
(...skipping 25 matching lines...) Expand all
94 } 94 }
95 @@ -162,7 +162,7 @@ 95 @@ -162,7 +162,7 @@
96 char x = *z; 96 char x = *z;
97 if( x==0 ) return 0; 97 if( x==0 ) return 0;
98 assert( x>='a' && x<='z' ); 98 assert( x>='a' && x<='z' );
99 - j = cType[x-'a']; 99 - j = cType[x-'a'];
100 + j = vOrCType[x-'a']; 100 + j = vOrCType[x-'a'];
101 if( j<2 ) return 1-j; 101 if( j<2 ) return 1-j;
102 return isConsonant(z + 1); 102 return isConsonant(z + 1);
103 } 103 }
OLDNEW
« no previous file with comments | « third_party/sqlite/amalgamation/sqlite3.c ('k') | third_party/sqlite/src/src/pager.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698