Fossil SCM

Clarify the difference between fossil_fatal() and fossil_panic(). The fossil_panic() interface puts a message on the error log when generating webpages. Otherwise the two routines are identical. Convert some fossil_fatal() calls into fossil_panic() where appropriate. The goal here is to limit messages on the error log to things that require attention from the system administrator, or represent bugs.

drh 2018-07-15 19:56 trunk
Commit 3f5ab71744cb6e2aa400352e6e8c7df8cf9ead7c90a12d4192f58c20e289f171
+1 -1
--- src/add.c
+++ src/add.c
@@ -875,11 +875,11 @@
875875
/* We should be done with options.. */
876876
verify_all_options();
877877
878878
vid = db_lget_int("checkout", 0);
879879
if( vid==0 ){
880
- fossil_fatal("no checkout rename files in");
880
+ fossil_fatal("no checkout in which to rename files");
881881
}
882882
if( g.argc<4 ){
883883
usage("OLDNAME NEWNAME");
884884
}
885885
zDest = g.argv[g.argc-1];
886886
--- src/add.c
+++ src/add.c
@@ -875,11 +875,11 @@
875 /* We should be done with options.. */
876 verify_all_options();
877
878 vid = db_lget_int("checkout", 0);
879 if( vid==0 ){
880 fossil_fatal("no checkout rename files in");
881 }
882 if( g.argc<4 ){
883 usage("OLDNAME NEWNAME");
884 }
885 zDest = g.argv[g.argc-1];
886
--- src/add.c
+++ src/add.c
@@ -875,11 +875,11 @@
875 /* We should be done with options.. */
876 verify_all_options();
877
878 vid = db_lget_int("checkout", 0);
879 if( vid==0 ){
880 fossil_fatal("no checkout in which to rename files");
881 }
882 if( g.argc<4 ){
883 usage("OLDNAME NEWNAME");
884 }
885 zDest = g.argv[g.argc-1];
886
+1 -1
--- src/blob.c
+++ src/blob.c
@@ -339,11 +339,11 @@
339339
** text was ever added using blob_appendf() then throw an error.
340340
*/
341341
char *blob_sql_text(Blob *p){
342342
blob_is_init(p);
343343
if( (p->blobFlags & BLOBFLAG_NotSQL) ){
344
- fossil_fatal("Internal error: Use of blob_appendf() to construct SQL text");
344
+ fossil_panic("use of blob_appendf() to construct SQL text");
345345
}
346346
return blob_str(p);
347347
}
348348
349349
350350
--- src/blob.c
+++ src/blob.c
@@ -339,11 +339,11 @@
339 ** text was ever added using blob_appendf() then throw an error.
340 */
341 char *blob_sql_text(Blob *p){
342 blob_is_init(p);
343 if( (p->blobFlags & BLOBFLAG_NotSQL) ){
344 fossil_fatal("Internal error: Use of blob_appendf() to construct SQL text");
345 }
346 return blob_str(p);
347 }
348
349
350
--- src/blob.c
+++ src/blob.c
@@ -339,11 +339,11 @@
339 ** text was ever added using blob_appendf() then throw an error.
340 */
341 char *blob_sql_text(Blob *p){
342 blob_is_init(p);
343 if( (p->blobFlags & BLOBFLAG_NotSQL) ){
344 fossil_panic("use of blob_appendf() to construct SQL text");
345 }
346 return blob_str(p);
347 }
348
349
350
+3 -3
--- src/bundle.c
+++ src/bundle.c
@@ -60,11 +60,11 @@
6060
if( !doInit && file_size(zFile, ExtFILE)<0 ){
6161
fossil_fatal("no such file: %s", zFile);
6262
}
6363
assert( g.db );
6464
zSql = sqlite3_mprintf("ATTACH %Q AS %Q", zFile, zBName);
65
- if( zSql==0 ) fossil_fatal("out of memory");
65
+ if( zSql==0 ) fossil_panic("out of memory");
6666
rc = sqlite3_exec(g.db, zSql, 0, 0, &zErrMsg);
6767
sqlite3_free(zSql);
6868
if( rc!=SQLITE_OK || zErrMsg ){
6969
if( zErrMsg==0 ) zErrMsg = (char*)sqlite3_errmsg(g.db);
7070
fossil_fatal("not a valid bundle: %s", zFile);
@@ -73,18 +73,18 @@
7373
db_multi_exec(zBundleInit /*works-like:"%w%w"*/, zBName, zBName);
7474
}else{
7575
sqlite3_stmt *pStmt;
7676
zSql = sqlite3_mprintf("SELECT bcname, bcvalue"
7777
" FROM \"%w\".bconfig", zBName);
78
- if( zSql==0 ) fossil_fatal("out of memory");
78
+ if( zSql==0 ) fossil_panic("out of memory");
7979
rc = sqlite3_prepare(g.db, zSql, -1, &pStmt, 0);
8080
if( rc ) fossil_fatal("not a valid bundle: %s", zFile);
8181
sqlite3_free(zSql);
8282
sqlite3_finalize(pStmt);
8383
zSql = sqlite3_mprintf("SELECT blobid, uuid, sz, delta, notes, data"
8484
" FROM \"%w\".bblob", zBName);
85
- if( zSql==0 ) fossil_fatal("out of memory");
85
+ if( zSql==0 ) fossil_panic("out of memory");
8686
rc = sqlite3_prepare(g.db, zSql, -1, &pStmt, 0);
8787
if( rc ) fossil_fatal("not a valid bundle: %s", zFile);
8888
sqlite3_free(zSql);
8989
sqlite3_finalize(pStmt);
9090
}
9191
--- src/bundle.c
+++ src/bundle.c
@@ -60,11 +60,11 @@
60 if( !doInit && file_size(zFile, ExtFILE)<0 ){
61 fossil_fatal("no such file: %s", zFile);
62 }
63 assert( g.db );
64 zSql = sqlite3_mprintf("ATTACH %Q AS %Q", zFile, zBName);
65 if( zSql==0 ) fossil_fatal("out of memory");
66 rc = sqlite3_exec(g.db, zSql, 0, 0, &zErrMsg);
67 sqlite3_free(zSql);
68 if( rc!=SQLITE_OK || zErrMsg ){
69 if( zErrMsg==0 ) zErrMsg = (char*)sqlite3_errmsg(g.db);
70 fossil_fatal("not a valid bundle: %s", zFile);
@@ -73,18 +73,18 @@
73 db_multi_exec(zBundleInit /*works-like:"%w%w"*/, zBName, zBName);
74 }else{
75 sqlite3_stmt *pStmt;
76 zSql = sqlite3_mprintf("SELECT bcname, bcvalue"
77 " FROM \"%w\".bconfig", zBName);
78 if( zSql==0 ) fossil_fatal("out of memory");
79 rc = sqlite3_prepare(g.db, zSql, -1, &pStmt, 0);
80 if( rc ) fossil_fatal("not a valid bundle: %s", zFile);
81 sqlite3_free(zSql);
82 sqlite3_finalize(pStmt);
83 zSql = sqlite3_mprintf("SELECT blobid, uuid, sz, delta, notes, data"
84 " FROM \"%w\".bblob", zBName);
85 if( zSql==0 ) fossil_fatal("out of memory");
86 rc = sqlite3_prepare(g.db, zSql, -1, &pStmt, 0);
87 if( rc ) fossil_fatal("not a valid bundle: %s", zFile);
88 sqlite3_free(zSql);
89 sqlite3_finalize(pStmt);
90 }
91
--- src/bundle.c
+++ src/bundle.c
@@ -60,11 +60,11 @@
60 if( !doInit && file_size(zFile, ExtFILE)<0 ){
61 fossil_fatal("no such file: %s", zFile);
62 }
63 assert( g.db );
64 zSql = sqlite3_mprintf("ATTACH %Q AS %Q", zFile, zBName);
65 if( zSql==0 ) fossil_panic("out of memory");
66 rc = sqlite3_exec(g.db, zSql, 0, 0, &zErrMsg);
67 sqlite3_free(zSql);
68 if( rc!=SQLITE_OK || zErrMsg ){
69 if( zErrMsg==0 ) zErrMsg = (char*)sqlite3_errmsg(g.db);
70 fossil_fatal("not a valid bundle: %s", zFile);
@@ -73,18 +73,18 @@
73 db_multi_exec(zBundleInit /*works-like:"%w%w"*/, zBName, zBName);
74 }else{
75 sqlite3_stmt *pStmt;
76 zSql = sqlite3_mprintf("SELECT bcname, bcvalue"
77 " FROM \"%w\".bconfig", zBName);
78 if( zSql==0 ) fossil_panic("out of memory");
79 rc = sqlite3_prepare(g.db, zSql, -1, &pStmt, 0);
80 if( rc ) fossil_fatal("not a valid bundle: %s", zFile);
81 sqlite3_free(zSql);
82 sqlite3_finalize(pStmt);
83 zSql = sqlite3_mprintf("SELECT blobid, uuid, sz, delta, notes, data"
84 " FROM \"%w\".bblob", zBName);
85 if( zSql==0 ) fossil_panic("out of memory");
86 rc = sqlite3_prepare(g.db, zSql, -1, &pStmt, 0);
87 if( rc ) fossil_fatal("not a valid bundle: %s", zFile);
88 sqlite3_free(zSql);
89 sqlite3_finalize(pStmt);
90 }
91
+15 -15
--- src/db.c
+++ src/db.c
@@ -488,11 +488,11 @@
488488
** Return the rowid of the most recent insert
489489
*/
490490
int db_last_insert_rowid(void){
491491
i64 x = sqlite3_last_insert_rowid(g.db);
492492
if( x<0 || x>(i64)2147483647 ){
493
- fossil_fatal("rowid out of range (0..2147483647)");
493
+ fossil_panic("rowid out of range (0..2147483647)");
494494
}
495495
return (int)x;
496496
}
497497
498498
/*
@@ -1030,11 +1030,11 @@
10301030
blobSize = blob_size(pKey);
10311031
if( blobSize==0 ) return;
10321032
fossil_get_page_size(&pageSize);
10331033
assert( pageSize>0 );
10341034
if( blobSize>pageSize ){
1035
- fossil_fatal("key blob too large: %u versus %u", blobSize, pageSize);
1035
+ fossil_panic("key blob too large: %u versus %u", blobSize, pageSize);
10361036
}
10371037
p = fossil_secure_alloc_page(&n);
10381038
assert( p!=NULL );
10391039
assert( n==pageSize );
10401040
assert( n>=blobSize );
@@ -1064,11 +1064,11 @@
10641064
size_t blobSize = blob_size(pKey);
10651065
if( blobSize==0 ){
10661066
db_unsave_encryption_key();
10671067
}else{
10681068
if( blobSize>savedKeySize ){
1069
- fossil_fatal("key blob too large: %u versus %u",
1069
+ fossil_panic("key blob too large: %u versus %u",
10701070
blobSize, savedKeySize);
10711071
}
10721072
fossil_secure_zero(zSavedKey, savedKeySize);
10731073
memcpy(zSavedKey, blob_str(pKey), blobSize);
10741074
}
@@ -1094,11 +1094,11 @@
10941094
HANDLE hProcess = NULL;
10951095
10961096
fossil_get_page_size(&pageSize);
10971097
assert( pageSize>0 );
10981098
if( nSize>pageSize ){
1099
- fossil_fatal("key too large: %u versus %u", nSize, pageSize);
1099
+ fossil_panic("key too large: %u versus %u", nSize, pageSize);
11001100
}
11011101
p = fossil_secure_alloc_page(&n);
11021102
assert( p!=NULL );
11031103
assert( n==pageSize );
11041104
assert( n>=nSize );
@@ -1110,20 +1110,20 @@
11101110
if( nRead==nSize ){
11111111
db_unsave_encryption_key();
11121112
zSavedKey = p;
11131113
savedKeySize = n;
11141114
}else{
1115
- fossil_fatal("bad size read, %u out of %u bytes at %p from pid %lu",
1115
+ fossil_panic("bad size read, %u out of %u bytes at %p from pid %lu",
11161116
nRead, nSize, pAddress, processId);
11171117
}
11181118
}else{
11191119
CloseHandle(hProcess);
1120
- fossil_fatal("failed read, %u bytes at %p from pid %lu: %lu", nSize,
1120
+ fossil_panic("failed read, %u bytes at %p from pid %lu: %lu", nSize,
11211121
pAddress, processId, GetLastError());
11221122
}
11231123
}else{
1124
- fossil_fatal("failed to open pid %lu: %lu", processId, GetLastError());
1124
+ fossil_panic("failed to open pid %lu: %lu", processId, GetLastError());
11251125
}
11261126
}
11271127
#endif /* defined(_WIN32) */
11281128
#endif /* USE_SEE */
11291129
@@ -1265,11 +1265,11 @@
12651265
** After calling this routine, db_database_slot(zLabel) should
12661266
** return 0.
12671267
*/
12681268
void db_set_main_schemaname(sqlite3 *db, const char *zLabel){
12691269
if( sqlite3_db_config(db, SQLITE_DBCONFIG_MAINDBNAME, zLabel) ){
1270
- fossil_fatal("Fossil requires a version of SQLite that supports the "
1270
+ fossil_panic("Fossil requires a version of SQLite that supports the "
12711271
"SQLITE_DBCONFIG_MAINDBNAME interface.");
12721272
}
12731273
}
12741274
12751275
/*
@@ -1366,27 +1366,27 @@
13661366
}
13671367
}
13681368
}
13691369
if( zHome==0 ){
13701370
if( isOptional ) return 0;
1371
- fossil_fatal("cannot locate home directory - please set the "
1371
+ fossil_panic("cannot locate home directory - please set the "
13721372
"FOSSIL_HOME, LOCALAPPDATA, APPDATA, or HOMEPATH "
13731373
"environment variables");
13741374
}
13751375
#else
13761376
if( zHome==0 ){
13771377
zHome = fossil_getenv("HOME");
13781378
}
13791379
if( zHome==0 ){
13801380
if( isOptional ) return 0;
1381
- fossil_fatal("cannot locate home directory - please set the "
1381
+ fossil_panic("cannot locate home directory - please set the "
13821382
"FOSSIL_HOME or HOME environment variables");
13831383
}
13841384
#endif
13851385
if( file_isdir(zHome, ExtFILE)!=1 ){
13861386
if( isOptional ) return 0;
1387
- fossil_fatal("invalid home directory: %s", zHome);
1387
+ fossil_panic("invalid home directory: %s", zHome);
13881388
}
13891389
#if defined(_WIN32) || defined(__CYGWIN__)
13901390
/* . filenames give some window systems problems and many apps problems */
13911391
zDbName = mprintf("%//_fossil", zHome);
13921392
#else
@@ -1393,17 +1393,17 @@
13931393
zDbName = mprintf("%s/.fossil", zHome);
13941394
#endif
13951395
if( file_size(zDbName, ExtFILE)<1024*3 ){
13961396
if( file_access(zHome, W_OK) ){
13971397
if( isOptional ) return 0;
1398
- fossil_fatal("home directory %s must be writeable", zHome);
1398
+ fossil_panic("home directory %s must be writeable", zHome);
13991399
}
14001400
db_init_database(zDbName, zConfigSchema, (char*)0);
14011401
}
14021402
if( file_access(zDbName, W_OK) ){
14031403
if( isOptional ) return 0;
1404
- fossil_fatal("configuration file %s must be writeable", zDbName);
1404
+ fossil_panic("configuration file %s must be writeable", zDbName);
14051405
}
14061406
if( useAttach ){
14071407
db_open_or_attach(zDbName, "configdb");
14081408
g.dbConfig = 0;
14091409
}else{
@@ -1680,13 +1680,13 @@
16801680
if( (bFlags & OPEN_OK_NOT_FOUND)==0 ){
16811681
#ifdef FOSSIL_ENABLE_JSON
16821682
g.json.resultCode = FSL_JSON_E_DB_NOT_FOUND;
16831683
#endif
16841684
if( nArgUsed==0 ){
1685
- fossil_fatal("use --repository or -R to specify the repository database");
1685
+ fossil_panic("use --repository or -R to specify the repository database");
16861686
}else{
1687
- fossil_fatal("specify the repository name as a command-line argument");
1687
+ fossil_panic("specify the repository name as a command-line argument");
16881688
}
16891689
}
16901690
}
16911691
16921692
/*
16931693
--- src/db.c
+++ src/db.c
@@ -488,11 +488,11 @@
488 ** Return the rowid of the most recent insert
489 */
490 int db_last_insert_rowid(void){
491 i64 x = sqlite3_last_insert_rowid(g.db);
492 if( x<0 || x>(i64)2147483647 ){
493 fossil_fatal("rowid out of range (0..2147483647)");
494 }
495 return (int)x;
496 }
497
498 /*
@@ -1030,11 +1030,11 @@
1030 blobSize = blob_size(pKey);
1031 if( blobSize==0 ) return;
1032 fossil_get_page_size(&pageSize);
1033 assert( pageSize>0 );
1034 if( blobSize>pageSize ){
1035 fossil_fatal("key blob too large: %u versus %u", blobSize, pageSize);
1036 }
1037 p = fossil_secure_alloc_page(&n);
1038 assert( p!=NULL );
1039 assert( n==pageSize );
1040 assert( n>=blobSize );
@@ -1064,11 +1064,11 @@
1064 size_t blobSize = blob_size(pKey);
1065 if( blobSize==0 ){
1066 db_unsave_encryption_key();
1067 }else{
1068 if( blobSize>savedKeySize ){
1069 fossil_fatal("key blob too large: %u versus %u",
1070 blobSize, savedKeySize);
1071 }
1072 fossil_secure_zero(zSavedKey, savedKeySize);
1073 memcpy(zSavedKey, blob_str(pKey), blobSize);
1074 }
@@ -1094,11 +1094,11 @@
1094 HANDLE hProcess = NULL;
1095
1096 fossil_get_page_size(&pageSize);
1097 assert( pageSize>0 );
1098 if( nSize>pageSize ){
1099 fossil_fatal("key too large: %u versus %u", nSize, pageSize);
1100 }
1101 p = fossil_secure_alloc_page(&n);
1102 assert( p!=NULL );
1103 assert( n==pageSize );
1104 assert( n>=nSize );
@@ -1110,20 +1110,20 @@
1110 if( nRead==nSize ){
1111 db_unsave_encryption_key();
1112 zSavedKey = p;
1113 savedKeySize = n;
1114 }else{
1115 fossil_fatal("bad size read, %u out of %u bytes at %p from pid %lu",
1116 nRead, nSize, pAddress, processId);
1117 }
1118 }else{
1119 CloseHandle(hProcess);
1120 fossil_fatal("failed read, %u bytes at %p from pid %lu: %lu", nSize,
1121 pAddress, processId, GetLastError());
1122 }
1123 }else{
1124 fossil_fatal("failed to open pid %lu: %lu", processId, GetLastError());
1125 }
1126 }
1127 #endif /* defined(_WIN32) */
1128 #endif /* USE_SEE */
1129
@@ -1265,11 +1265,11 @@
1265 ** After calling this routine, db_database_slot(zLabel) should
1266 ** return 0.
1267 */
1268 void db_set_main_schemaname(sqlite3 *db, const char *zLabel){
1269 if( sqlite3_db_config(db, SQLITE_DBCONFIG_MAINDBNAME, zLabel) ){
1270 fossil_fatal("Fossil requires a version of SQLite that supports the "
1271 "SQLITE_DBCONFIG_MAINDBNAME interface.");
1272 }
1273 }
1274
1275 /*
@@ -1366,27 +1366,27 @@
1366 }
1367 }
1368 }
1369 if( zHome==0 ){
1370 if( isOptional ) return 0;
1371 fossil_fatal("cannot locate home directory - please set the "
1372 "FOSSIL_HOME, LOCALAPPDATA, APPDATA, or HOMEPATH "
1373 "environment variables");
1374 }
1375 #else
1376 if( zHome==0 ){
1377 zHome = fossil_getenv("HOME");
1378 }
1379 if( zHome==0 ){
1380 if( isOptional ) return 0;
1381 fossil_fatal("cannot locate home directory - please set the "
1382 "FOSSIL_HOME or HOME environment variables");
1383 }
1384 #endif
1385 if( file_isdir(zHome, ExtFILE)!=1 ){
1386 if( isOptional ) return 0;
1387 fossil_fatal("invalid home directory: %s", zHome);
1388 }
1389 #if defined(_WIN32) || defined(__CYGWIN__)
1390 /* . filenames give some window systems problems and many apps problems */
1391 zDbName = mprintf("%//_fossil", zHome);
1392 #else
@@ -1393,17 +1393,17 @@
1393 zDbName = mprintf("%s/.fossil", zHome);
1394 #endif
1395 if( file_size(zDbName, ExtFILE)<1024*3 ){
1396 if( file_access(zHome, W_OK) ){
1397 if( isOptional ) return 0;
1398 fossil_fatal("home directory %s must be writeable", zHome);
1399 }
1400 db_init_database(zDbName, zConfigSchema, (char*)0);
1401 }
1402 if( file_access(zDbName, W_OK) ){
1403 if( isOptional ) return 0;
1404 fossil_fatal("configuration file %s must be writeable", zDbName);
1405 }
1406 if( useAttach ){
1407 db_open_or_attach(zDbName, "configdb");
1408 g.dbConfig = 0;
1409 }else{
@@ -1680,13 +1680,13 @@
1680 if( (bFlags & OPEN_OK_NOT_FOUND)==0 ){
1681 #ifdef FOSSIL_ENABLE_JSON
1682 g.json.resultCode = FSL_JSON_E_DB_NOT_FOUND;
1683 #endif
1684 if( nArgUsed==0 ){
1685 fossil_fatal("use --repository or -R to specify the repository database");
1686 }else{
1687 fossil_fatal("specify the repository name as a command-line argument");
1688 }
1689 }
1690 }
1691
1692 /*
1693
--- src/db.c
+++ src/db.c
@@ -488,11 +488,11 @@
488 ** Return the rowid of the most recent insert
489 */
490 int db_last_insert_rowid(void){
491 i64 x = sqlite3_last_insert_rowid(g.db);
492 if( x<0 || x>(i64)2147483647 ){
493 fossil_panic("rowid out of range (0..2147483647)");
494 }
495 return (int)x;
496 }
497
498 /*
@@ -1030,11 +1030,11 @@
1030 blobSize = blob_size(pKey);
1031 if( blobSize==0 ) return;
1032 fossil_get_page_size(&pageSize);
1033 assert( pageSize>0 );
1034 if( blobSize>pageSize ){
1035 fossil_panic("key blob too large: %u versus %u", blobSize, pageSize);
1036 }
1037 p = fossil_secure_alloc_page(&n);
1038 assert( p!=NULL );
1039 assert( n==pageSize );
1040 assert( n>=blobSize );
@@ -1064,11 +1064,11 @@
1064 size_t blobSize = blob_size(pKey);
1065 if( blobSize==0 ){
1066 db_unsave_encryption_key();
1067 }else{
1068 if( blobSize>savedKeySize ){
1069 fossil_panic("key blob too large: %u versus %u",
1070 blobSize, savedKeySize);
1071 }
1072 fossil_secure_zero(zSavedKey, savedKeySize);
1073 memcpy(zSavedKey, blob_str(pKey), blobSize);
1074 }
@@ -1094,11 +1094,11 @@
1094 HANDLE hProcess = NULL;
1095
1096 fossil_get_page_size(&pageSize);
1097 assert( pageSize>0 );
1098 if( nSize>pageSize ){
1099 fossil_panic("key too large: %u versus %u", nSize, pageSize);
1100 }
1101 p = fossil_secure_alloc_page(&n);
1102 assert( p!=NULL );
1103 assert( n==pageSize );
1104 assert( n>=nSize );
@@ -1110,20 +1110,20 @@
1110 if( nRead==nSize ){
1111 db_unsave_encryption_key();
1112 zSavedKey = p;
1113 savedKeySize = n;
1114 }else{
1115 fossil_panic("bad size read, %u out of %u bytes at %p from pid %lu",
1116 nRead, nSize, pAddress, processId);
1117 }
1118 }else{
1119 CloseHandle(hProcess);
1120 fossil_panic("failed read, %u bytes at %p from pid %lu: %lu", nSize,
1121 pAddress, processId, GetLastError());
1122 }
1123 }else{
1124 fossil_panic("failed to open pid %lu: %lu", processId, GetLastError());
1125 }
1126 }
1127 #endif /* defined(_WIN32) */
1128 #endif /* USE_SEE */
1129
@@ -1265,11 +1265,11 @@
1265 ** After calling this routine, db_database_slot(zLabel) should
1266 ** return 0.
1267 */
1268 void db_set_main_schemaname(sqlite3 *db, const char *zLabel){
1269 if( sqlite3_db_config(db, SQLITE_DBCONFIG_MAINDBNAME, zLabel) ){
1270 fossil_panic("Fossil requires a version of SQLite that supports the "
1271 "SQLITE_DBCONFIG_MAINDBNAME interface.");
1272 }
1273 }
1274
1275 /*
@@ -1366,27 +1366,27 @@
1366 }
1367 }
1368 }
1369 if( zHome==0 ){
1370 if( isOptional ) return 0;
1371 fossil_panic("cannot locate home directory - please set the "
1372 "FOSSIL_HOME, LOCALAPPDATA, APPDATA, or HOMEPATH "
1373 "environment variables");
1374 }
1375 #else
1376 if( zHome==0 ){
1377 zHome = fossil_getenv("HOME");
1378 }
1379 if( zHome==0 ){
1380 if( isOptional ) return 0;
1381 fossil_panic("cannot locate home directory - please set the "
1382 "FOSSIL_HOME or HOME environment variables");
1383 }
1384 #endif
1385 if( file_isdir(zHome, ExtFILE)!=1 ){
1386 if( isOptional ) return 0;
1387 fossil_panic("invalid home directory: %s", zHome);
1388 }
1389 #if defined(_WIN32) || defined(__CYGWIN__)
1390 /* . filenames give some window systems problems and many apps problems */
1391 zDbName = mprintf("%//_fossil", zHome);
1392 #else
@@ -1393,17 +1393,17 @@
1393 zDbName = mprintf("%s/.fossil", zHome);
1394 #endif
1395 if( file_size(zDbName, ExtFILE)<1024*3 ){
1396 if( file_access(zHome, W_OK) ){
1397 if( isOptional ) return 0;
1398 fossil_panic("home directory %s must be writeable", zHome);
1399 }
1400 db_init_database(zDbName, zConfigSchema, (char*)0);
1401 }
1402 if( file_access(zDbName, W_OK) ){
1403 if( isOptional ) return 0;
1404 fossil_panic("configuration file %s must be writeable", zDbName);
1405 }
1406 if( useAttach ){
1407 db_open_or_attach(zDbName, "configdb");
1408 g.dbConfig = 0;
1409 }else{
@@ -1680,13 +1680,13 @@
1680 if( (bFlags & OPEN_OK_NOT_FOUND)==0 ){
1681 #ifdef FOSSIL_ENABLE_JSON
1682 g.json.resultCode = FSL_JSON_E_DB_NOT_FOUND;
1683 #endif
1684 if( nArgUsed==0 ){
1685 fossil_panic("use --repository or -R to specify the repository database");
1686 }else{
1687 fossil_panic("specify the repository name as a command-line argument");
1688 }
1689 }
1690 }
1691
1692 /*
1693
+1 -1
--- src/dispatch.c
+++ src/dispatch.c
@@ -167,11 +167,11 @@
167167
zQ = &z[i+1];
168168
}else{
169169
zQ = &z[i];
170170
}
171171
if( dispatch_name_search(z, CMDFLAG_WEBPAGE, ppCmd) ){
172
- fossil_fatal("\"%s\" aliased to \"%s\" but \"%s\" does not exist",
172
+ fossil_panic("\"%s\" aliased to \"%s\" but \"%s\" does not exist",
173173
zName, z, z);
174174
}
175175
z = zQ;
176176
while( *z ){
177177
char *zName = z;
178178
--- src/dispatch.c
+++ src/dispatch.c
@@ -167,11 +167,11 @@
167 zQ = &z[i+1];
168 }else{
169 zQ = &z[i];
170 }
171 if( dispatch_name_search(z, CMDFLAG_WEBPAGE, ppCmd) ){
172 fossil_fatal("\"%s\" aliased to \"%s\" but \"%s\" does not exist",
173 zName, z, z);
174 }
175 z = zQ;
176 while( *z ){
177 char *zName = z;
178
--- src/dispatch.c
+++ src/dispatch.c
@@ -167,11 +167,11 @@
167 zQ = &z[i+1];
168 }else{
169 zQ = &z[i];
170 }
171 if( dispatch_name_search(z, CMDFLAG_WEBPAGE, ppCmd) ){
172 fossil_panic("\"%s\" aliased to \"%s\" but \"%s\" does not exist",
173 zName, z, z);
174 }
175 z = zQ;
176 while( *z ){
177 char *zName = z;
178
+1 -1
--- src/doc.c
+++ src/doc.c
@@ -298,11 +298,11 @@
298298
*/
299299
static void mimetype_verify(void){
300300
int i;
301301
for(i=1; i<count(aMime); i++){
302302
if( fossil_strcmp(aMime[i-1].zSuffix,aMime[i].zSuffix)>=0 ){
303
- fossil_fatal("mimetypes out of sequence: %s before %s",
303
+ fossil_panic("mimetypes out of sequence: %s before %s",
304304
aMime[i-1].zSuffix, aMime[i].zSuffix);
305305
}
306306
}
307307
}
308308
309309
--- src/doc.c
+++ src/doc.c
@@ -298,11 +298,11 @@
298 */
299 static void mimetype_verify(void){
300 int i;
301 for(i=1; i<count(aMime); i++){
302 if( fossil_strcmp(aMime[i-1].zSuffix,aMime[i].zSuffix)>=0 ){
303 fossil_fatal("mimetypes out of sequence: %s before %s",
304 aMime[i-1].zSuffix, aMime[i].zSuffix);
305 }
306 }
307 }
308
309
--- src/doc.c
+++ src/doc.c
@@ -298,11 +298,11 @@
298 */
299 static void mimetype_verify(void){
300 int i;
301 for(i=1; i<count(aMime); i++){
302 if( fossil_strcmp(aMime[i-1].zSuffix,aMime[i].zSuffix)>=0 ){
303 fossil_panic("mimetypes out of sequence: %s before %s",
304 aMime[i-1].zSuffix, aMime[i].zSuffix);
305 }
306 }
307 }
308
309
+1 -1
--- src/event.c
+++ src/event.c
@@ -587,9 +587,9 @@
587587
if (event_commit_common(rid, zId, blob_str(pContent), zETime,
588588
zMimeType, zComment, zTags, zClr)==0 ){
589589
#ifdef FOSSIL_ENABLE_JSON
590590
g.json.resultCode = FSL_JSON_E_ASSERT;
591591
#endif
592
- fossil_fatal("Internal error: Fossil tried to make an "
592
+ fossil_panic("Internal error: Fossil tried to make an "
593593
"invalid artifact for the technote.");
594594
}
595595
}
596596
--- src/event.c
+++ src/event.c
@@ -587,9 +587,9 @@
587 if (event_commit_common(rid, zId, blob_str(pContent), zETime,
588 zMimeType, zComment, zTags, zClr)==0 ){
589 #ifdef FOSSIL_ENABLE_JSON
590 g.json.resultCode = FSL_JSON_E_ASSERT;
591 #endif
592 fossil_fatal("Internal error: Fossil tried to make an "
593 "invalid artifact for the technote.");
594 }
595 }
596
--- src/event.c
+++ src/event.c
@@ -587,9 +587,9 @@
587 if (event_commit_common(rid, zId, blob_str(pContent), zETime,
588 zMimeType, zComment, zTags, zClr)==0 ){
589 #ifdef FOSSIL_ENABLE_JSON
590 g.json.resultCode = FSL_JSON_E_ASSERT;
591 #endif
592 fossil_panic("Internal error: Fossil tried to make an "
593 "invalid artifact for the technote.");
594 }
595 }
596
+2 -2
--- src/file.c
+++ src/file.c
@@ -896,13 +896,13 @@
896896
#ifdef _WIN32
897897
win32_getcwd(zBuf, nBuf);
898898
#else
899899
if( getcwd(zBuf, nBuf-1)==0 ){
900900
if( errno==ERANGE ){
901
- fossil_fatal("pwd too big: max %d", nBuf-1);
901
+ fossil_panic("pwd too big: max %d", nBuf-1);
902902
}else{
903
- fossil_fatal("cannot find current working directory; %s",
903
+ fossil_panic("cannot find current working directory; %s",
904904
strerror(errno));
905905
}
906906
}
907907
#endif
908908
}
909909
--- src/file.c
+++ src/file.c
@@ -896,13 +896,13 @@
896 #ifdef _WIN32
897 win32_getcwd(zBuf, nBuf);
898 #else
899 if( getcwd(zBuf, nBuf-1)==0 ){
900 if( errno==ERANGE ){
901 fossil_fatal("pwd too big: max %d", nBuf-1);
902 }else{
903 fossil_fatal("cannot find current working directory; %s",
904 strerror(errno));
905 }
906 }
907 #endif
908 }
909
--- src/file.c
+++ src/file.c
@@ -896,13 +896,13 @@
896 #ifdef _WIN32
897 win32_getcwd(zBuf, nBuf);
898 #else
899 if( getcwd(zBuf, nBuf-1)==0 ){
900 if( errno==ERANGE ){
901 fossil_panic("pwd too big: max %d", nBuf-1);
902 }else{
903 fossil_panic("cannot find current working directory; %s",
904 strerror(errno));
905 }
906 }
907 #endif
908 }
909
+3 -3
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -111,11 +111,11 @@
111111
X509_STORE_set_default_paths(SSL_CTX_get_cert_store(sslCtx));
112112
}else{
113113
/* User has specified a CA location, make sure it exists and use it */
114114
switch( file_isdir(zCaSetting, ExtFILE) ){
115115
case 0: { /* doesn't exist */
116
- fossil_fatal("ssl-ca-location is set to '%s', "
116
+ fossil_panic("ssl-ca-location is set to '%s', "
117117
"but is not a file or directory", zCaSetting);
118118
break;
119119
}
120120
case 1: { /* directory */
121121
zCaDirectory = zCaSetting;
@@ -125,11 +125,11 @@
125125
zCaFile = zCaSetting;
126126
break;
127127
}
128128
}
129129
if( SSL_CTX_load_verify_locations(sslCtx, zCaFile, zCaDirectory)==0 ){
130
- fossil_fatal("Failed to use CA root certificates from "
130
+ fossil_panic("Failed to use CA root certificates from "
131131
"ssl-ca-location '%s'", zCaSetting);
132132
}
133133
}
134134
135135
/* Load client SSL identity, preferring the filename specified on the
@@ -141,11 +141,11 @@
141141
}
142142
if( identityFile!=0 && identityFile[0]!='\0' ){
143143
if( SSL_CTX_use_certificate_file(sslCtx,identityFile,SSL_FILETYPE_PEM)!=1
144144
|| SSL_CTX_use_PrivateKey_file(sslCtx,identityFile,SSL_FILETYPE_PEM)!=1
145145
){
146
- fossil_fatal("Could not load SSL identity from %s", identityFile);
146
+ fossil_panic("Could not load SSL identity from %s", identityFile);
147147
}
148148
}
149149
/* Register a callback to tell the user what to do when the server asks
150150
** for a cert */
151151
SSL_CTX_set_client_cert_cb(sslCtx, ssl_client_cert_callback);
152152
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -111,11 +111,11 @@
111 X509_STORE_set_default_paths(SSL_CTX_get_cert_store(sslCtx));
112 }else{
113 /* User has specified a CA location, make sure it exists and use it */
114 switch( file_isdir(zCaSetting, ExtFILE) ){
115 case 0: { /* doesn't exist */
116 fossil_fatal("ssl-ca-location is set to '%s', "
117 "but is not a file or directory", zCaSetting);
118 break;
119 }
120 case 1: { /* directory */
121 zCaDirectory = zCaSetting;
@@ -125,11 +125,11 @@
125 zCaFile = zCaSetting;
126 break;
127 }
128 }
129 if( SSL_CTX_load_verify_locations(sslCtx, zCaFile, zCaDirectory)==0 ){
130 fossil_fatal("Failed to use CA root certificates from "
131 "ssl-ca-location '%s'", zCaSetting);
132 }
133 }
134
135 /* Load client SSL identity, preferring the filename specified on the
@@ -141,11 +141,11 @@
141 }
142 if( identityFile!=0 && identityFile[0]!='\0' ){
143 if( SSL_CTX_use_certificate_file(sslCtx,identityFile,SSL_FILETYPE_PEM)!=1
144 || SSL_CTX_use_PrivateKey_file(sslCtx,identityFile,SSL_FILETYPE_PEM)!=1
145 ){
146 fossil_fatal("Could not load SSL identity from %s", identityFile);
147 }
148 }
149 /* Register a callback to tell the user what to do when the server asks
150 ** for a cert */
151 SSL_CTX_set_client_cert_cb(sslCtx, ssl_client_cert_callback);
152
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -111,11 +111,11 @@
111 X509_STORE_set_default_paths(SSL_CTX_get_cert_store(sslCtx));
112 }else{
113 /* User has specified a CA location, make sure it exists and use it */
114 switch( file_isdir(zCaSetting, ExtFILE) ){
115 case 0: { /* doesn't exist */
116 fossil_panic("ssl-ca-location is set to '%s', "
117 "but is not a file or directory", zCaSetting);
118 break;
119 }
120 case 1: { /* directory */
121 zCaDirectory = zCaSetting;
@@ -125,11 +125,11 @@
125 zCaFile = zCaSetting;
126 break;
127 }
128 }
129 if( SSL_CTX_load_verify_locations(sslCtx, zCaFile, zCaDirectory)==0 ){
130 fossil_panic("Failed to use CA root certificates from "
131 "ssl-ca-location '%s'", zCaSetting);
132 }
133 }
134
135 /* Load client SSL identity, preferring the filename specified on the
@@ -141,11 +141,11 @@
141 }
142 if( identityFile!=0 && identityFile[0]!='\0' ){
143 if( SSL_CTX_use_certificate_file(sslCtx,identityFile,SSL_FILETYPE_PEM)!=1
144 || SSL_CTX_use_PrivateKey_file(sslCtx,identityFile,SSL_FILETYPE_PEM)!=1
145 ){
146 fossil_panic("Could not load SSL identity from %s", identityFile);
147 }
148 }
149 /* Register a callback to tell the user what to do when the server asks
150 ** for a cert */
151 SSL_CTX_set_client_cert_cb(sslCtx, ssl_client_cert_callback);
152
--- src/http_transport.c
+++ src/http_transport.c
@@ -127,19 +127,19 @@
127127
fossil_free(zHost);
128128
}else{
129129
blob_append_escaped_arg(&zCmd, pUrlData->name);
130130
}
131131
if( !is_safe_fossil_command(pUrlData->fossil) ){
132
- fossil_fatal("the ssh:// URL is asking to run an unsafe command [%s] on "
132
+ fossil_panic("the ssh:// URL is asking to run an unsafe command [%s] on "
133133
"the server.", pUrlData->fossil);
134134
}
135135
blob_append_escaped_arg(&zCmd, pUrlData->fossil);
136136
blob_append(&zCmd, " test-http", 10);
137137
if( pUrlData->path && pUrlData->path[0] ){
138138
blob_append_escaped_arg(&zCmd, pUrlData->path);
139139
}else{
140
- fossil_fatal("ssh:// URI does not specify a path to the repository");
140
+ fossil_panic("ssh:// URI does not specify a path to the repository");
141141
}
142142
if( g.fSshTrace ){
143143
fossil_print("%s\n", blob_str(&zCmd)); /* Show the whole SSH command */
144144
}
145145
popen2(blob_str(&zCmd), &sshIn, &sshOut, &sshPid);
@@ -181,11 +181,11 @@
181181
g.zRepositoryName, iRandId);
182182
transport.zInFile = mprintf("%s-%llu-in.http",
183183
g.zRepositoryName, iRandId);
184184
transport.pFile = fossil_fopen(transport.zOutFile, "wb");
185185
if( transport.pFile==0 ){
186
- fossil_fatal("cannot output temporary file: %s", transport.zOutFile);
186
+ fossil_panic("cannot output temporary file: %s", transport.zOutFile);
187187
}
188188
transport.isOpen = 1;
189189
}else{
190190
rc = socket_open(pUrlData);
191191
if( rc==0 ) transport.isOpen = 1;
192192
--- src/http_transport.c
+++ src/http_transport.c
@@ -127,19 +127,19 @@
127 fossil_free(zHost);
128 }else{
129 blob_append_escaped_arg(&zCmd, pUrlData->name);
130 }
131 if( !is_safe_fossil_command(pUrlData->fossil) ){
132 fossil_fatal("the ssh:// URL is asking to run an unsafe command [%s] on "
133 "the server.", pUrlData->fossil);
134 }
135 blob_append_escaped_arg(&zCmd, pUrlData->fossil);
136 blob_append(&zCmd, " test-http", 10);
137 if( pUrlData->path && pUrlData->path[0] ){
138 blob_append_escaped_arg(&zCmd, pUrlData->path);
139 }else{
140 fossil_fatal("ssh:// URI does not specify a path to the repository");
141 }
142 if( g.fSshTrace ){
143 fossil_print("%s\n", blob_str(&zCmd)); /* Show the whole SSH command */
144 }
145 popen2(blob_str(&zCmd), &sshIn, &sshOut, &sshPid);
@@ -181,11 +181,11 @@
181 g.zRepositoryName, iRandId);
182 transport.zInFile = mprintf("%s-%llu-in.http",
183 g.zRepositoryName, iRandId);
184 transport.pFile = fossil_fopen(transport.zOutFile, "wb");
185 if( transport.pFile==0 ){
186 fossil_fatal("cannot output temporary file: %s", transport.zOutFile);
187 }
188 transport.isOpen = 1;
189 }else{
190 rc = socket_open(pUrlData);
191 if( rc==0 ) transport.isOpen = 1;
192
--- src/http_transport.c
+++ src/http_transport.c
@@ -127,19 +127,19 @@
127 fossil_free(zHost);
128 }else{
129 blob_append_escaped_arg(&zCmd, pUrlData->name);
130 }
131 if( !is_safe_fossil_command(pUrlData->fossil) ){
132 fossil_panic("the ssh:// URL is asking to run an unsafe command [%s] on "
133 "the server.", pUrlData->fossil);
134 }
135 blob_append_escaped_arg(&zCmd, pUrlData->fossil);
136 blob_append(&zCmd, " test-http", 10);
137 if( pUrlData->path && pUrlData->path[0] ){
138 blob_append_escaped_arg(&zCmd, pUrlData->path);
139 }else{
140 fossil_panic("ssh:// URI does not specify a path to the repository");
141 }
142 if( g.fSshTrace ){
143 fossil_print("%s\n", blob_str(&zCmd)); /* Show the whole SSH command */
144 }
145 popen2(blob_str(&zCmd), &sshIn, &sshOut, &sshPid);
@@ -181,11 +181,11 @@
181 g.zRepositoryName, iRandId);
182 transport.zInFile = mprintf("%s-%llu-in.http",
183 g.zRepositoryName, iRandId);
184 transport.pFile = fossil_fopen(transport.zOutFile, "wb");
185 if( transport.pFile==0 ){
186 fossil_panic("cannot output temporary file: %s", transport.zOutFile);
187 }
188 transport.isOpen = 1;
189 }else{
190 rc = socket_open(pUrlData);
191 if( rc==0 ) transport.isOpen = 1;
192
+1 -1
--- src/import.c
+++ src/import.c
@@ -606,11 +606,11 @@
606606
if( gg.nData ){
607607
int got;
608608
gg.aData = fossil_malloc( gg.nData+1 );
609609
got = fread(gg.aData, 1, gg.nData, pIn);
610610
if( got!=gg.nData ){
611
- fossil_fatal("short read: got %d of %d bytes", got, gg.nData);
611
+ fossil_panic("short read: got %d of %d bytes", got, gg.nData);
612612
}
613613
gg.aData[got] = '\0';
614614
if( gg.zComment==0 &&
615615
(gg.xFinish==finish_commit || gg.xFinish==finish_tag) ){
616616
/* Strip trailing newline, it's appended to the comment. */
617617
--- src/import.c
+++ src/import.c
@@ -606,11 +606,11 @@
606 if( gg.nData ){
607 int got;
608 gg.aData = fossil_malloc( gg.nData+1 );
609 got = fread(gg.aData, 1, gg.nData, pIn);
610 if( got!=gg.nData ){
611 fossil_fatal("short read: got %d of %d bytes", got, gg.nData);
612 }
613 gg.aData[got] = '\0';
614 if( gg.zComment==0 &&
615 (gg.xFinish==finish_commit || gg.xFinish==finish_tag) ){
616 /* Strip trailing newline, it's appended to the comment. */
617
--- src/import.c
+++ src/import.c
@@ -606,11 +606,11 @@
606 if( gg.nData ){
607 int got;
608 gg.aData = fossil_malloc( gg.nData+1 );
609 got = fread(gg.aData, 1, gg.nData, pIn);
610 if( got!=gg.nData ){
611 fossil_panic("short read: got %d of %d bytes", got, gg.nData);
612 }
613 gg.aData[got] = '\0';
614 if( gg.zComment==0 &&
615 (gg.xFinish==finish_commit || gg.xFinish==finish_tag) ){
616 /* Strip trailing newline, it's appended to the comment. */
617
+1 -1
--- src/json.c
+++ src/json.c
@@ -996,11 +996,11 @@
996996
inFile = (0==strcmp("-",jfile))
997997
? stdin
998998
: fossil_fopen(jfile,"rb");
999999
if(!inFile){
10001000
g.json.resultCode = FSL_JSON_E_FILE_OPEN_FAILED;
1001
- fossil_fatal("Could not open JSON file [%s].",jfile)
1001
+ fossil_panic("Could not open JSON file [%s].",jfile)
10021002
/* Does not return. */
10031003
;
10041004
}
10051005
cgi_parse_POST_JSON(inFile, 0);
10061006
if( stdin != inFile ){
10071007
--- src/json.c
+++ src/json.c
@@ -996,11 +996,11 @@
996 inFile = (0==strcmp("-",jfile))
997 ? stdin
998 : fossil_fopen(jfile,"rb");
999 if(!inFile){
1000 g.json.resultCode = FSL_JSON_E_FILE_OPEN_FAILED;
1001 fossil_fatal("Could not open JSON file [%s].",jfile)
1002 /* Does not return. */
1003 ;
1004 }
1005 cgi_parse_POST_JSON(inFile, 0);
1006 if( stdin != inFile ){
1007
--- src/json.c
+++ src/json.c
@@ -996,11 +996,11 @@
996 inFile = (0==strcmp("-",jfile))
997 ? stdin
998 : fossil_fopen(jfile,"rb");
999 if(!inFile){
1000 g.json.resultCode = FSL_JSON_E_FILE_OPEN_FAILED;
1001 fossil_panic("Could not open JSON file [%s].",jfile)
1002 /* Does not return. */
1003 ;
1004 }
1005 cgi_parse_POST_JSON(inFile, 0);
1006 if( stdin != inFile ){
1007
--- src/json_branch.c
+++ src/json_branch.c
@@ -288,15 +288,15 @@
288288
md5sum_blob(&branch, &mcksum);
289289
blob_appendf(&branch, "Z %b\n", &mcksum);
290290
291291
brid = content_put(&branch);
292292
if( brid==0 ){
293
- fossil_fatal("Problem committing manifest: %s", g.zErrMsg);
293
+ fossil_panic("Problem committing manifest: %s", g.zErrMsg);
294294
}
295295
db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d)", brid);
296296
if( manifest_crosslink(brid, &branch, MC_PERMIT_HOOKS)==0 ){
297
- fossil_fatal("%s", g.zErrMsg);
297
+ fossil_panic("%s", g.zErrMsg);
298298
}
299299
assert( blob_is_reset(&branch) );
300300
content_deltify(rootid, &brid, 1, 0);
301301
if( zNewRid ){
302302
*zNewRid = brid;
303303
--- src/json_branch.c
+++ src/json_branch.c
@@ -288,15 +288,15 @@
288 md5sum_blob(&branch, &mcksum);
289 blob_appendf(&branch, "Z %b\n", &mcksum);
290
291 brid = content_put(&branch);
292 if( brid==0 ){
293 fossil_fatal("Problem committing manifest: %s", g.zErrMsg);
294 }
295 db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d)", brid);
296 if( manifest_crosslink(brid, &branch, MC_PERMIT_HOOKS)==0 ){
297 fossil_fatal("%s", g.zErrMsg);
298 }
299 assert( blob_is_reset(&branch) );
300 content_deltify(rootid, &brid, 1, 0);
301 if( zNewRid ){
302 *zNewRid = brid;
303
--- src/json_branch.c
+++ src/json_branch.c
@@ -288,15 +288,15 @@
288 md5sum_blob(&branch, &mcksum);
289 blob_appendf(&branch, "Z %b\n", &mcksum);
290
291 brid = content_put(&branch);
292 if( brid==0 ){
293 fossil_panic("Problem committing manifest: %s", g.zErrMsg);
294 }
295 db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d)", brid);
296 if( manifest_crosslink(brid, &branch, MC_PERMIT_HOOKS)==0 ){
297 fossil_panic("%s", g.zErrMsg);
298 }
299 assert( blob_is_reset(&branch) );
300 content_deltify(rootid, &brid, 1, 0);
301 if( zNewRid ){
302 *zNewRid = brid;
303
--- src/json_status.c
+++ src/json_status.c
@@ -168,11 +168,11 @@
168168
blob_append(report, zPrefix, nPrefix);
169169
blob_appendf(report, "%s %s\n", zLabel, db_column_text(&q, 0));
170170
}
171171
db_finalize(&q);
172172
if( nErr ){
173
- fossil_fatal("aborting due to prior errors");
173
+ fossil_panic("aborting due to prior errors");
174174
}
175175
#endif
176176
return cson_object_value( oPay );
177177
}
178178
179179
--- src/json_status.c
+++ src/json_status.c
@@ -168,11 +168,11 @@
168 blob_append(report, zPrefix, nPrefix);
169 blob_appendf(report, "%s %s\n", zLabel, db_column_text(&q, 0));
170 }
171 db_finalize(&q);
172 if( nErr ){
173 fossil_fatal("aborting due to prior errors");
174 }
175 #endif
176 return cson_object_value( oPay );
177 }
178
179
--- src/json_status.c
+++ src/json_status.c
@@ -168,11 +168,11 @@
168 blob_append(report, zPrefix, nPrefix);
169 blob_appendf(report, "%s %s\n", zLabel, db_column_text(&q, 0));
170 }
171 db_finalize(&q);
172 if( nErr ){
173 fossil_panic("aborting due to prior errors");
174 }
175 #endif
176 return cson_object_value( oPay );
177 }
178
179
+17 -17
--- src/main.c
+++ src/main.c
@@ -597,11 +597,11 @@
597597
const CmdOrPage *pCmd = 0;
598598
int rc;
599599
600600
fossil_limit_memory(1);
601601
if( sqlite3_libversion_number()<3014000 ){
602
- fossil_fatal("Unsuitable SQLite version %s, must be at least 3.14.0",
602
+ fossil_panic("Unsuitable SQLite version %s, must be at least 3.14.0",
603603
sqlite3_libversion());
604604
}
605605
sqlite3_config(SQLITE_CONFIG_MULTITHREAD);
606606
sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0);
607607
memset(&g, 0, sizeof(g));
@@ -635,11 +635,11 @@
635635
if( g.zVfsName ){
636636
sqlite3_vfs *pVfs = sqlite3_vfs_find(g.zVfsName);
637637
if( pVfs ){
638638
sqlite3_vfs_register(pVfs, 1);
639639
}else{
640
- fossil_fatal("no such VFS: \"%s\"", g.zVfsName);
640
+ fossil_panic("no such VFS: \"%s\"", g.zVfsName);
641641
}
642642
}
643643
if( fossil_getenv("GATEWAY_INTERFACE")!=0 && !find_option("nocgi", 0, 0)){
644644
zCmdName = "cgi";
645645
g.isHTTP = 1;
@@ -686,11 +686,11 @@
686686
g.zErrlog = find_option("errorlog", 0, 1);
687687
fossil_init_flags_from_options();
688688
if( find_option("utc",0,0) ) g.fTimeFormat = 1;
689689
if( find_option("localtime",0,0) ) g.fTimeFormat = 2;
690690
if( zChdir && file_chdir(zChdir, 0) ){
691
- fossil_fatal("unable to change directories to %s", zChdir);
691
+ fossil_panic("unable to change directories to %s", zChdir);
692692
}
693693
if( find_option("help",0,0)!=0 ){
694694
/* If --help is found anywhere on the command line, translate the command
695695
* to "fossil help cmdname" where "cmdname" is the first argument that
696696
* does not begin with a "-" character. If all arguments start with "-",
@@ -735,11 +735,11 @@
735735
}while( nTry++ < 2 );
736736
if( fd<2 ){
737737
g.cgiOutput = 1;
738738
g.httpOut = stdout;
739739
g.fullHttpReply = !g.isHTTP;
740
- fossil_fatal("file descriptor 2 is not open. (fd=%d, errno=%d)",
740
+ fossil_panic("file descriptor 2 is not open. (fd=%d, errno=%d)",
741741
fd, x);
742742
}
743743
}
744744
#endif
745745
rc = dispatch_name_search(zCmdName, CMDFLAG_COMMAND|CMDFLAG_PREFIX, &pCmd);
@@ -751,11 +751,11 @@
751751
rc = TH_OK;
752752
}
753753
if( rc==TH_OK || rc==TH_RETURN || rc==TH_CONTINUE ){
754754
if( rc==TH_OK || rc==TH_RETURN ){
755755
#endif
756
- fossil_fatal("%s: unknown command: %s\n"
756
+ fossil_panic("%s: unknown command: %s\n"
757757
"%s: use \"help\" for more information",
758758
g.argv[0], zCmdName, g.argv[0]);
759759
#ifdef FOSSIL_ENABLE_TH1_HOOKS
760760
}
761761
if( !g.isHTTP && !g.fNoThHook && (rc==TH_OK || rc==TH_CONTINUE) ){
@@ -816,11 +816,11 @@
816816
817817
/*
818818
** Print a usage comment and quit
819819
*/
820820
void usage(const char *zFormat){
821
- fossil_fatal("Usage: %s %s %s", g.argv[0], g.argv[1], zFormat);
821
+ fossil_panic("Usage: %s %s %s", g.argv[0], g.argv[1], zFormat);
822822
}
823823
824824
/*
825825
** Remove n elements from g.argv beginning with the i-th element.
826826
*/
@@ -934,11 +934,11 @@
934934
*/
935935
void verify_all_options(void){
936936
int i;
937937
for(i=1; i<g.argc; i++){
938938
if( g.argv[i][0]=='-' && g.argv[i][1]!=0 ){
939
- fossil_fatal(
939
+ fossil_panic(
940940
"unrecognized command-line option, or missing argument: %s",
941941
g.argv[i]);
942942
}
943943
}
944944
}
@@ -1153,11 +1153,11 @@
11531153
g.zHttpsURL = mprintf("https://%s", &g.zTop[7]);
11541154
}else if( strncmp(g.zTop, "https://", 8)==0 ){
11551155
/* it is already HTTPS, use it. */
11561156
g.zHttpsURL = mprintf("%s", g.zTop);
11571157
}else{
1158
- fossil_fatal("argument to --baseurl should be 'http://host/path'"
1158
+ fossil_panic("argument to --baseurl should be 'http://host/path'"
11591159
" or 'https://host/path'");
11601160
}
11611161
for(i=n=0; (c = g.zTop[i])!=0; i++){
11621162
if( c=='/' ){
11631163
n++;
@@ -1166,11 +1166,11 @@
11661166
break;
11671167
}
11681168
}
11691169
}
11701170
if( g.zTop==g.zBaseURL ){
1171
- fossil_fatal("argument to --baseurl should be 'http://host/path'"
1171
+ fossil_panic("argument to --baseurl should be 'http://host/path'"
11721172
" or 'https://host/path'");
11731173
}
11741174
if( g.zTop[1]==0 ) g.zTop++;
11751175
}else{
11761176
zHost = PD("HTTP_HOST","");
@@ -1237,34 +1237,34 @@
12371237
file_canonical_name(zRepo, &dir, 0);
12381238
zDir = blob_str(&dir);
12391239
if( !noJail ){
12401240
if( file_isdir(zDir, ExtFILE)==1 ){
12411241
if( file_chdir(zDir, 1) ){
1242
- fossil_fatal("unable to chroot into %s", zDir);
1242
+ fossil_panic("unable to chroot into %s", zDir);
12431243
}
12441244
g.fJail = 1;
12451245
zRepo = "/";
12461246
}else{
12471247
for(i=strlen(zDir)-1; i>0 && zDir[i]!='/'; i--){}
1248
- if( zDir[i]!='/' ) fossil_fatal("bad repository name: %s", zRepo);
1248
+ if( zDir[i]!='/' ) fossil_panic("bad repository name: %s", zRepo);
12491249
if( i>0 ){
12501250
zDir[i] = 0;
12511251
if( file_chdir(zDir, 1) ){
1252
- fossil_fatal("unable to chroot into %s", zDir);
1252
+ fossil_panic("unable to chroot into %s", zDir);
12531253
}
12541254
zDir[i] = '/';
12551255
}
12561256
zRepo = &zDir[i];
12571257
}
12581258
}
12591259
if( stat(zRepo, &sStat)!=0 ){
1260
- fossil_fatal("cannot stat() repository: %s", zRepo);
1260
+ fossil_panic("cannot stat() repository: %s", zRepo);
12611261
}
12621262
i = setgid(sStat.st_gid);
12631263
i = i || setuid(sStat.st_uid);
12641264
if(i){
1265
- fossil_fatal("setgid/uid() failed with errno %d", errno);
1265
+ fossil_panic("setgid/uid() failed with errno %d", errno);
12661266
}
12671267
if( g.db==0 && file_isfile(zRepo, ExtFILE) ){
12681268
db_open_repository(zRepo);
12691269
}
12701270
}
@@ -2227,11 +2227,11 @@
22272227
){
22282228
unsigned int nSize = 0;
22292229
if( sscanf(zPidKey, "%lu:%p:%u", pProcessId, ppAddress, &nSize)==3 ){
22302230
*pnSize = (SIZE_T)nSize;
22312231
}else{
2232
- fossil_fatal("failed to parse pid key");
2232
+ fossil_panic("failed to parse pid key");
22332233
}
22342234
}
22352235
#endif
22362236
22372237
/*
@@ -2348,11 +2348,11 @@
23482348
23492349
/* We should be done with options.. */
23502350
verify_all_options();
23512351
23522352
if( g.argc!=2 && g.argc!=3 && g.argc!=5 && g.argc!=6 ){
2353
- fossil_fatal("no repository specified");
2353
+ fossil_panic("no repository specified");
23542354
}
23552355
g.cgiOutput = 1;
23562356
g.fullHttpReply = 1;
23572357
if( g.argc>=5 ){
23582358
g.httpIn = fossil_fopen(g.argv[2], "rb");
@@ -2675,11 +2675,11 @@
26752675
}
26762676
if( g.repositoryOpen ) flags |= HTTP_SERVER_HAD_REPOSITORY;
26772677
if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT;
26782678
db_close(1);
26792679
if( cgi_http_server(iPort, mxPort, zBrowserCmd, zIpAddr, flags) ){
2680
- fossil_fatal("unable to listen on TCP socket %d", iPort);
2680
+ fossil_panic("unable to listen on TCP socket %d", iPort);
26812681
}
26822682
if( zMaxLatency ){
26832683
signal(SIGALRM, sigalrm_handler);
26842684
alarm(atoi(zMaxLatency));
26852685
}
26862686
--- src/main.c
+++ src/main.c
@@ -597,11 +597,11 @@
597 const CmdOrPage *pCmd = 0;
598 int rc;
599
600 fossil_limit_memory(1);
601 if( sqlite3_libversion_number()<3014000 ){
602 fossil_fatal("Unsuitable SQLite version %s, must be at least 3.14.0",
603 sqlite3_libversion());
604 }
605 sqlite3_config(SQLITE_CONFIG_MULTITHREAD);
606 sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0);
607 memset(&g, 0, sizeof(g));
@@ -635,11 +635,11 @@
635 if( g.zVfsName ){
636 sqlite3_vfs *pVfs = sqlite3_vfs_find(g.zVfsName);
637 if( pVfs ){
638 sqlite3_vfs_register(pVfs, 1);
639 }else{
640 fossil_fatal("no such VFS: \"%s\"", g.zVfsName);
641 }
642 }
643 if( fossil_getenv("GATEWAY_INTERFACE")!=0 && !find_option("nocgi", 0, 0)){
644 zCmdName = "cgi";
645 g.isHTTP = 1;
@@ -686,11 +686,11 @@
686 g.zErrlog = find_option("errorlog", 0, 1);
687 fossil_init_flags_from_options();
688 if( find_option("utc",0,0) ) g.fTimeFormat = 1;
689 if( find_option("localtime",0,0) ) g.fTimeFormat = 2;
690 if( zChdir && file_chdir(zChdir, 0) ){
691 fossil_fatal("unable to change directories to %s", zChdir);
692 }
693 if( find_option("help",0,0)!=0 ){
694 /* If --help is found anywhere on the command line, translate the command
695 * to "fossil help cmdname" where "cmdname" is the first argument that
696 * does not begin with a "-" character. If all arguments start with "-",
@@ -735,11 +735,11 @@
735 }while( nTry++ < 2 );
736 if( fd<2 ){
737 g.cgiOutput = 1;
738 g.httpOut = stdout;
739 g.fullHttpReply = !g.isHTTP;
740 fossil_fatal("file descriptor 2 is not open. (fd=%d, errno=%d)",
741 fd, x);
742 }
743 }
744 #endif
745 rc = dispatch_name_search(zCmdName, CMDFLAG_COMMAND|CMDFLAG_PREFIX, &pCmd);
@@ -751,11 +751,11 @@
751 rc = TH_OK;
752 }
753 if( rc==TH_OK || rc==TH_RETURN || rc==TH_CONTINUE ){
754 if( rc==TH_OK || rc==TH_RETURN ){
755 #endif
756 fossil_fatal("%s: unknown command: %s\n"
757 "%s: use \"help\" for more information",
758 g.argv[0], zCmdName, g.argv[0]);
759 #ifdef FOSSIL_ENABLE_TH1_HOOKS
760 }
761 if( !g.isHTTP && !g.fNoThHook && (rc==TH_OK || rc==TH_CONTINUE) ){
@@ -816,11 +816,11 @@
816
817 /*
818 ** Print a usage comment and quit
819 */
820 void usage(const char *zFormat){
821 fossil_fatal("Usage: %s %s %s", g.argv[0], g.argv[1], zFormat);
822 }
823
824 /*
825 ** Remove n elements from g.argv beginning with the i-th element.
826 */
@@ -934,11 +934,11 @@
934 */
935 void verify_all_options(void){
936 int i;
937 for(i=1; i<g.argc; i++){
938 if( g.argv[i][0]=='-' && g.argv[i][1]!=0 ){
939 fossil_fatal(
940 "unrecognized command-line option, or missing argument: %s",
941 g.argv[i]);
942 }
943 }
944 }
@@ -1153,11 +1153,11 @@
1153 g.zHttpsURL = mprintf("https://%s", &g.zTop[7]);
1154 }else if( strncmp(g.zTop, "https://", 8)==0 ){
1155 /* it is already HTTPS, use it. */
1156 g.zHttpsURL = mprintf("%s", g.zTop);
1157 }else{
1158 fossil_fatal("argument to --baseurl should be 'http://host/path'"
1159 " or 'https://host/path'");
1160 }
1161 for(i=n=0; (c = g.zTop[i])!=0; i++){
1162 if( c=='/' ){
1163 n++;
@@ -1166,11 +1166,11 @@
1166 break;
1167 }
1168 }
1169 }
1170 if( g.zTop==g.zBaseURL ){
1171 fossil_fatal("argument to --baseurl should be 'http://host/path'"
1172 " or 'https://host/path'");
1173 }
1174 if( g.zTop[1]==0 ) g.zTop++;
1175 }else{
1176 zHost = PD("HTTP_HOST","");
@@ -1237,34 +1237,34 @@
1237 file_canonical_name(zRepo, &dir, 0);
1238 zDir = blob_str(&dir);
1239 if( !noJail ){
1240 if( file_isdir(zDir, ExtFILE)==1 ){
1241 if( file_chdir(zDir, 1) ){
1242 fossil_fatal("unable to chroot into %s", zDir);
1243 }
1244 g.fJail = 1;
1245 zRepo = "/";
1246 }else{
1247 for(i=strlen(zDir)-1; i>0 && zDir[i]!='/'; i--){}
1248 if( zDir[i]!='/' ) fossil_fatal("bad repository name: %s", zRepo);
1249 if( i>0 ){
1250 zDir[i] = 0;
1251 if( file_chdir(zDir, 1) ){
1252 fossil_fatal("unable to chroot into %s", zDir);
1253 }
1254 zDir[i] = '/';
1255 }
1256 zRepo = &zDir[i];
1257 }
1258 }
1259 if( stat(zRepo, &sStat)!=0 ){
1260 fossil_fatal("cannot stat() repository: %s", zRepo);
1261 }
1262 i = setgid(sStat.st_gid);
1263 i = i || setuid(sStat.st_uid);
1264 if(i){
1265 fossil_fatal("setgid/uid() failed with errno %d", errno);
1266 }
1267 if( g.db==0 && file_isfile(zRepo, ExtFILE) ){
1268 db_open_repository(zRepo);
1269 }
1270 }
@@ -2227,11 +2227,11 @@
2227 ){
2228 unsigned int nSize = 0;
2229 if( sscanf(zPidKey, "%lu:%p:%u", pProcessId, ppAddress, &nSize)==3 ){
2230 *pnSize = (SIZE_T)nSize;
2231 }else{
2232 fossil_fatal("failed to parse pid key");
2233 }
2234 }
2235 #endif
2236
2237 /*
@@ -2348,11 +2348,11 @@
2348
2349 /* We should be done with options.. */
2350 verify_all_options();
2351
2352 if( g.argc!=2 && g.argc!=3 && g.argc!=5 && g.argc!=6 ){
2353 fossil_fatal("no repository specified");
2354 }
2355 g.cgiOutput = 1;
2356 g.fullHttpReply = 1;
2357 if( g.argc>=5 ){
2358 g.httpIn = fossil_fopen(g.argv[2], "rb");
@@ -2675,11 +2675,11 @@
2675 }
2676 if( g.repositoryOpen ) flags |= HTTP_SERVER_HAD_REPOSITORY;
2677 if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT;
2678 db_close(1);
2679 if( cgi_http_server(iPort, mxPort, zBrowserCmd, zIpAddr, flags) ){
2680 fossil_fatal("unable to listen on TCP socket %d", iPort);
2681 }
2682 if( zMaxLatency ){
2683 signal(SIGALRM, sigalrm_handler);
2684 alarm(atoi(zMaxLatency));
2685 }
2686
--- src/main.c
+++ src/main.c
@@ -597,11 +597,11 @@
597 const CmdOrPage *pCmd = 0;
598 int rc;
599
600 fossil_limit_memory(1);
601 if( sqlite3_libversion_number()<3014000 ){
602 fossil_panic("Unsuitable SQLite version %s, must be at least 3.14.0",
603 sqlite3_libversion());
604 }
605 sqlite3_config(SQLITE_CONFIG_MULTITHREAD);
606 sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0);
607 memset(&g, 0, sizeof(g));
@@ -635,11 +635,11 @@
635 if( g.zVfsName ){
636 sqlite3_vfs *pVfs = sqlite3_vfs_find(g.zVfsName);
637 if( pVfs ){
638 sqlite3_vfs_register(pVfs, 1);
639 }else{
640 fossil_panic("no such VFS: \"%s\"", g.zVfsName);
641 }
642 }
643 if( fossil_getenv("GATEWAY_INTERFACE")!=0 && !find_option("nocgi", 0, 0)){
644 zCmdName = "cgi";
645 g.isHTTP = 1;
@@ -686,11 +686,11 @@
686 g.zErrlog = find_option("errorlog", 0, 1);
687 fossil_init_flags_from_options();
688 if( find_option("utc",0,0) ) g.fTimeFormat = 1;
689 if( find_option("localtime",0,0) ) g.fTimeFormat = 2;
690 if( zChdir && file_chdir(zChdir, 0) ){
691 fossil_panic("unable to change directories to %s", zChdir);
692 }
693 if( find_option("help",0,0)!=0 ){
694 /* If --help is found anywhere on the command line, translate the command
695 * to "fossil help cmdname" where "cmdname" is the first argument that
696 * does not begin with a "-" character. If all arguments start with "-",
@@ -735,11 +735,11 @@
735 }while( nTry++ < 2 );
736 if( fd<2 ){
737 g.cgiOutput = 1;
738 g.httpOut = stdout;
739 g.fullHttpReply = !g.isHTTP;
740 fossil_panic("file descriptor 2 is not open. (fd=%d, errno=%d)",
741 fd, x);
742 }
743 }
744 #endif
745 rc = dispatch_name_search(zCmdName, CMDFLAG_COMMAND|CMDFLAG_PREFIX, &pCmd);
@@ -751,11 +751,11 @@
751 rc = TH_OK;
752 }
753 if( rc==TH_OK || rc==TH_RETURN || rc==TH_CONTINUE ){
754 if( rc==TH_OK || rc==TH_RETURN ){
755 #endif
756 fossil_panic("%s: unknown command: %s\n"
757 "%s: use \"help\" for more information",
758 g.argv[0], zCmdName, g.argv[0]);
759 #ifdef FOSSIL_ENABLE_TH1_HOOKS
760 }
761 if( !g.isHTTP && !g.fNoThHook && (rc==TH_OK || rc==TH_CONTINUE) ){
@@ -816,11 +816,11 @@
816
817 /*
818 ** Print a usage comment and quit
819 */
820 void usage(const char *zFormat){
821 fossil_panic("Usage: %s %s %s", g.argv[0], g.argv[1], zFormat);
822 }
823
824 /*
825 ** Remove n elements from g.argv beginning with the i-th element.
826 */
@@ -934,11 +934,11 @@
934 */
935 void verify_all_options(void){
936 int i;
937 for(i=1; i<g.argc; i++){
938 if( g.argv[i][0]=='-' && g.argv[i][1]!=0 ){
939 fossil_panic(
940 "unrecognized command-line option, or missing argument: %s",
941 g.argv[i]);
942 }
943 }
944 }
@@ -1153,11 +1153,11 @@
1153 g.zHttpsURL = mprintf("https://%s", &g.zTop[7]);
1154 }else if( strncmp(g.zTop, "https://", 8)==0 ){
1155 /* it is already HTTPS, use it. */
1156 g.zHttpsURL = mprintf("%s", g.zTop);
1157 }else{
1158 fossil_panic("argument to --baseurl should be 'http://host/path'"
1159 " or 'https://host/path'");
1160 }
1161 for(i=n=0; (c = g.zTop[i])!=0; i++){
1162 if( c=='/' ){
1163 n++;
@@ -1166,11 +1166,11 @@
1166 break;
1167 }
1168 }
1169 }
1170 if( g.zTop==g.zBaseURL ){
1171 fossil_panic("argument to --baseurl should be 'http://host/path'"
1172 " or 'https://host/path'");
1173 }
1174 if( g.zTop[1]==0 ) g.zTop++;
1175 }else{
1176 zHost = PD("HTTP_HOST","");
@@ -1237,34 +1237,34 @@
1237 file_canonical_name(zRepo, &dir, 0);
1238 zDir = blob_str(&dir);
1239 if( !noJail ){
1240 if( file_isdir(zDir, ExtFILE)==1 ){
1241 if( file_chdir(zDir, 1) ){
1242 fossil_panic("unable to chroot into %s", zDir);
1243 }
1244 g.fJail = 1;
1245 zRepo = "/";
1246 }else{
1247 for(i=strlen(zDir)-1; i>0 && zDir[i]!='/'; i--){}
1248 if( zDir[i]!='/' ) fossil_panic("bad repository name: %s", zRepo);
1249 if( i>0 ){
1250 zDir[i] = 0;
1251 if( file_chdir(zDir, 1) ){
1252 fossil_panic("unable to chroot into %s", zDir);
1253 }
1254 zDir[i] = '/';
1255 }
1256 zRepo = &zDir[i];
1257 }
1258 }
1259 if( stat(zRepo, &sStat)!=0 ){
1260 fossil_panic("cannot stat() repository: %s", zRepo);
1261 }
1262 i = setgid(sStat.st_gid);
1263 i = i || setuid(sStat.st_uid);
1264 if(i){
1265 fossil_panic("setgid/uid() failed with errno %d", errno);
1266 }
1267 if( g.db==0 && file_isfile(zRepo, ExtFILE) ){
1268 db_open_repository(zRepo);
1269 }
1270 }
@@ -2227,11 +2227,11 @@
2227 ){
2228 unsigned int nSize = 0;
2229 if( sscanf(zPidKey, "%lu:%p:%u", pProcessId, ppAddress, &nSize)==3 ){
2230 *pnSize = (SIZE_T)nSize;
2231 }else{
2232 fossil_panic("failed to parse pid key");
2233 }
2234 }
2235 #endif
2236
2237 /*
@@ -2348,11 +2348,11 @@
2348
2349 /* We should be done with options.. */
2350 verify_all_options();
2351
2352 if( g.argc!=2 && g.argc!=3 && g.argc!=5 && g.argc!=6 ){
2353 fossil_panic("no repository specified");
2354 }
2355 g.cgiOutput = 1;
2356 g.fullHttpReply = 1;
2357 if( g.argc>=5 ){
2358 g.httpIn = fossil_fopen(g.argv[2], "rb");
@@ -2675,11 +2675,11 @@
2675 }
2676 if( g.repositoryOpen ) flags |= HTTP_SERVER_HAD_REPOSITORY;
2677 if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT;
2678 db_close(1);
2679 if( cgi_http_server(iPort, mxPort, zBrowserCmd, zIpAddr, flags) ){
2680 fossil_panic("unable to listen on TCP socket %d", iPort);
2681 }
2682 if( zMaxLatency ){
2683 signal(SIGALRM, sigalrm_handler);
2684 alarm(atoi(zMaxLatency));
2685 }
2686
+1 -1
--- src/manifest.c
+++ src/manifest.c
@@ -1059,11 +1059,11 @@
10591059
"INSERT OR IGNORE INTO orphan(rid, baseline) VALUES(%d,%d)",
10601060
p->rid, rid
10611061
);
10621062
return 1;
10631063
}
1064
- fossil_fatal("cannot access baseline manifest %S", p->zBaseline);
1064
+ fossil_panic("cannot access baseline manifest %S", p->zBaseline);
10651065
}
10661066
}
10671067
return 0;
10681068
}
10691069
10701070
--- src/manifest.c
+++ src/manifest.c
@@ -1059,11 +1059,11 @@
1059 "INSERT OR IGNORE INTO orphan(rid, baseline) VALUES(%d,%d)",
1060 p->rid, rid
1061 );
1062 return 1;
1063 }
1064 fossil_fatal("cannot access baseline manifest %S", p->zBaseline);
1065 }
1066 }
1067 return 0;
1068 }
1069
1070
--- src/manifest.c
+++ src/manifest.c
@@ -1059,11 +1059,11 @@
1059 "INSERT OR IGNORE INTO orphan(rid, baseline) VALUES(%d,%d)",
1060 p->rid, rid
1061 );
1062 return 1;
1063 }
1064 fossil_panic("cannot access baseline manifest %S", p->zBaseline);
1065 }
1066 }
1067 return 0;
1068 }
1069
1070
+1 -1
--- src/popen.c
+++ src/popen.c
@@ -25,11 +25,11 @@
2525
#include <fcntl.h>
2626
/*
2727
** Print a fatal error and quit.
2828
*/
2929
static void win32_fatal_error(const char *zMsg){
30
- fossil_fatal("%s", zMsg);
30
+ fossil_panic("%s", zMsg);
3131
}
3232
#else
3333
#include <signal.h>
3434
#include <sys/wait.h>
3535
#endif
3636
--- src/popen.c
+++ src/popen.c
@@ -25,11 +25,11 @@
25 #include <fcntl.h>
26 /*
27 ** Print a fatal error and quit.
28 */
29 static void win32_fatal_error(const char *zMsg){
30 fossil_fatal("%s", zMsg);
31 }
32 #else
33 #include <signal.h>
34 #include <sys/wait.h>
35 #endif
36
--- src/popen.c
+++ src/popen.c
@@ -25,11 +25,11 @@
25 #include <fcntl.h>
26 /*
27 ** Print a fatal error and quit.
28 */
29 static void win32_fatal_error(const char *zMsg){
30 fossil_panic("%s", zMsg);
31 }
32 #else
33 #include <signal.h>
34 #include <sys/wait.h>
35 #endif
36
--- src/printf.c
+++ src/printf.c
@@ -1059,10 +1059,16 @@
10591059
}
10601060
10611061
/*
10621062
** Print an error message, rollback all databases, and quit. These
10631063
** routines never return.
1064
+**
1065
+** The only different between fossil_fatal() and fossil_panic() is that
1066
+** fossil_panic() makes an entry in the error log whereas fossil_fatal()
1067
+** does not. If there is not error log, then both routines work the
1068
+** same. Hence, the routines are interchangable for commands and only
1069
+** make a difference with processing web pages.
10641070
**
10651071
** Use fossil_fatal() for malformed inputs that should be reported back
10661072
** to the user, but which do not represent a configuration problem or bug.
10671073
**
10681074
** Use fossil_panic() for any kind of error that should be brought to the
10691075
--- src/printf.c
+++ src/printf.c
@@ -1059,10 +1059,16 @@
1059 }
1060
1061 /*
1062 ** Print an error message, rollback all databases, and quit. These
1063 ** routines never return.
 
 
 
 
 
 
1064 **
1065 ** Use fossil_fatal() for malformed inputs that should be reported back
1066 ** to the user, but which do not represent a configuration problem or bug.
1067 **
1068 ** Use fossil_panic() for any kind of error that should be brought to the
1069
--- src/printf.c
+++ src/printf.c
@@ -1059,10 +1059,16 @@
1059 }
1060
1061 /*
1062 ** Print an error message, rollback all databases, and quit. These
1063 ** routines never return.
1064 **
1065 ** The only different between fossil_fatal() and fossil_panic() is that
1066 ** fossil_panic() makes an entry in the error log whereas fossil_fatal()
1067 ** does not. If there is not error log, then both routines work the
1068 ** same. Hence, the routines are interchangable for commands and only
1069 ** make a difference with processing web pages.
1070 **
1071 ** Use fossil_fatal() for malformed inputs that should be reported back
1072 ** to the user, but which do not represent a configuration problem or bug.
1073 **
1074 ** Use fossil_panic() for any kind of error that should be brought to the
1075
+1 -1
--- src/purge.c
+++ src/purge.c
@@ -122,11 +122,11 @@
122122
123123
/* Make sure we are not removing a manifest that is the baseline of some
124124
** manifest that is being left behind. This step is not strictly necessary.
125125
** is is just a safety check. */
126126
if( purge_baseline_out_from_under_delta(zTab) ){
127
- fossil_fatal("attempt to purge a baseline manifest without also purging "
127
+ fossil_panic("attempt to purge a baseline manifest without also purging "
128128
"all of its deltas");
129129
}
130130
131131
/* Make sure that no delta that is left behind requires a purged artifact
132132
** as its basis. If such artifacts exist, go ahead and undelta them now.
133133
--- src/purge.c
+++ src/purge.c
@@ -122,11 +122,11 @@
122
123 /* Make sure we are not removing a manifest that is the baseline of some
124 ** manifest that is being left behind. This step is not strictly necessary.
125 ** is is just a safety check. */
126 if( purge_baseline_out_from_under_delta(zTab) ){
127 fossil_fatal("attempt to purge a baseline manifest without also purging "
128 "all of its deltas");
129 }
130
131 /* Make sure that no delta that is left behind requires a purged artifact
132 ** as its basis. If such artifacts exist, go ahead and undelta them now.
133
--- src/purge.c
+++ src/purge.c
@@ -122,11 +122,11 @@
122
123 /* Make sure we are not removing a manifest that is the baseline of some
124 ** manifest that is being left behind. This step is not strictly necessary.
125 ** is is just a safety check. */
126 if( purge_baseline_out_from_under_delta(zTab) ){
127 fossil_panic("attempt to purge a baseline manifest without also purging "
128 "all of its deltas");
129 }
130
131 /* Make sure that no delta that is left behind requires a purged artifact
132 ** as its basis. If such artifacts exist, go ahead and undelta them now.
133
+1 -1
--- src/skins.c
+++ src/skins.c
@@ -254,11 +254,11 @@
254254
*/
255255
const char *skin_detail(const char *zName){
256256
struct SkinDetail *pDetail;
257257
skin_detail_initialize();
258258
pDetail = skin_detail_find(zName);
259
- if( pDetail==0 ) fossil_fatal("no such skin detail: %s", zName);
259
+ if( pDetail==0 ) fossil_panic("no such skin detail: %s", zName);
260260
return pDetail->zValue;
261261
}
262262
int skin_detail_boolean(const char *zName){
263263
return !is_false(skin_detail(zName));
264264
}
265265
--- src/skins.c
+++ src/skins.c
@@ -254,11 +254,11 @@
254 */
255 const char *skin_detail(const char *zName){
256 struct SkinDetail *pDetail;
257 skin_detail_initialize();
258 pDetail = skin_detail_find(zName);
259 if( pDetail==0 ) fossil_fatal("no such skin detail: %s", zName);
260 return pDetail->zValue;
261 }
262 int skin_detail_boolean(const char *zName){
263 return !is_false(skin_detail(zName));
264 }
265
--- src/skins.c
+++ src/skins.c
@@ -254,11 +254,11 @@
254 */
255 const char *skin_detail(const char *zName){
256 struct SkinDetail *pDetail;
257 skin_detail_initialize();
258 pDetail = skin_detail_find(zName);
259 if( pDetail==0 ) fossil_panic("no such skin detail: %s", zName);
260 return pDetail->zValue;
261 }
262 int skin_detail_boolean(const char *zName){
263 return !is_false(skin_detail(zName));
264 }
265
+1 -1
--- src/sqlcmd.c
+++ src/sqlcmd.c
@@ -215,11 +215,11 @@
215215
*pnKey = (int)strlen(zKey);
216216
}else{
217217
*pnKey = -1;
218218
}
219219
}else{
220
- fossil_fatal("failed to allocate %u bytes for key", nByte);
220
+ fossil_panic("failed to allocate %u bytes for key", nByte);
221221
}
222222
}
223223
#endif
224224
225225
/*
226226
--- src/sqlcmd.c
+++ src/sqlcmd.c
@@ -215,11 +215,11 @@
215 *pnKey = (int)strlen(zKey);
216 }else{
217 *pnKey = -1;
218 }
219 }else{
220 fossil_fatal("failed to allocate %u bytes for key", nByte);
221 }
222 }
223 #endif
224
225 /*
226
--- src/sqlcmd.c
+++ src/sqlcmd.c
@@ -215,11 +215,11 @@
215 *pnKey = (int)strlen(zKey);
216 }else{
217 *pnKey = -1;
218 }
219 }else{
220 fossil_panic("failed to allocate %u bytes for key", nByte);
221 }
222 }
223 #endif
224
225 /*
226
+1 -1
--- src/tar.c
+++ src/tar.c
@@ -252,11 +252,11 @@
252252
}
253253
/* build the string */
254254
blob_appendf(&tball.pax, "%d %s=%*.*s\n", blen, zField, nValue, nValue, zValue);
255255
/* this _must_ be right */
256256
if(blob_size(&tball.pax) != blen){
257
- fossil_fatal("internal error: PAX tar header has bad length");
257
+ fossil_panic("internal error: PAX tar header has bad length");
258258
}
259259
}
260260
261261
262262
/*
263263
--- src/tar.c
+++ src/tar.c
@@ -252,11 +252,11 @@
252 }
253 /* build the string */
254 blob_appendf(&tball.pax, "%d %s=%*.*s\n", blen, zField, nValue, nValue, zValue);
255 /* this _must_ be right */
256 if(blob_size(&tball.pax) != blen){
257 fossil_fatal("internal error: PAX tar header has bad length");
258 }
259 }
260
261
262 /*
263
--- src/tar.c
+++ src/tar.c
@@ -252,11 +252,11 @@
252 }
253 /* build the string */
254 blob_appendf(&tball.pax, "%d %s=%*.*s\n", blen, zField, nValue, nValue, zValue);
255 /* this _must_ be right */
256 if(blob_size(&tball.pax) != blen){
257 fossil_panic("internal error: PAX tar header has bad length");
258 }
259 }
260
261
262 /*
263
+11 -11
--- src/util.c
+++ src/util.c
@@ -98,22 +98,22 @@
9898
assert( pageSize>0 );
9999
assert( pageSize%2==0 );
100100
#if defined(_WIN32)
101101
p = VirtualAlloc(NULL, pageSize, MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE);
102102
if( p==NULL ){
103
- fossil_fatal("VirtualAlloc failed: %lu\n", GetLastError());
103
+ fossil_panic("VirtualAlloc failed: %lu\n", GetLastError());
104104
}
105105
if( !VirtualLock(p, pageSize) ){
106
- fossil_fatal("VirtualLock failed: %lu\n", GetLastError());
106
+ fossil_panic("VirtualLock failed: %lu\n", GetLastError());
107107
}
108108
#elif defined(USE_MMAN_H)
109109
p = mmap(0, pageSize, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
110110
if( p==MAP_FAILED ){
111
- fossil_fatal("mmap failed: %d\n", errno);
111
+ fossil_panic("mmap failed: %d\n", errno);
112112
}
113113
if( mlock(p, pageSize) ){
114
- fossil_fatal("mlock failed: %d\n", errno);
114
+ fossil_panic("mlock failed: %d\n", errno);
115115
}
116116
#else
117117
p = fossil_malloc(pageSize);
118118
#endif
119119
fossil_secure_zero(p, pageSize);
@@ -124,21 +124,21 @@
124124
if( !p ) return;
125125
assert( n>0 );
126126
fossil_secure_zero(p, n);
127127
#if defined(_WIN32)
128128
if( !VirtualUnlock(p, n) ){
129
- fossil_fatal("VirtualUnlock failed: %lu\n", GetLastError());
129
+ fossil_panic("VirtualUnlock failed: %lu\n", GetLastError());
130130
}
131131
if( !VirtualFree(p, 0, MEM_RELEASE) ){
132
- fossil_fatal("VirtualFree failed: %lu\n", GetLastError());
132
+ fossil_panic("VirtualFree failed: %lu\n", GetLastError());
133133
}
134134
#elif defined(USE_MMAN_H)
135135
if( munlock(p, n) ){
136
- fossil_fatal("munlock failed: %d\n", errno);
136
+ fossil_panic("munlock failed: %d\n", errno);
137137
}
138138
if( munmap(p, n) ){
139
- fossil_fatal("munmap failed: %d\n", errno);
139
+ fossil_panic("munmap failed: %d\n", errno);
140140
}
141141
#else
142142
fossil_free(p);
143143
#endif
144144
}
@@ -322,11 +322,11 @@
322322
*/
323323
sqlite3_uint64 fossil_timer_fetch(int timerId){
324324
if( timerId>0 && timerId<=FOSSIL_TIMER_COUNT ){
325325
struct FossilTimer * start = &fossilTimerList[timerId-1];
326326
if( !start->id ){
327
- fossil_fatal("Invalid call to fetch a non-allocated "
327
+ fossil_panic("Invalid call to fetch a non-allocated "
328328
"timer (#%d)", timerId);
329329
/*NOTREACHED*/
330330
}else{
331331
sqlite3_uint64 eu = 0, es = 0;
332332
fossil_cpu_times( &eu, &es );
@@ -342,11 +342,11 @@
342342
*/
343343
sqlite3_uint64 fossil_timer_reset(int timerId){
344344
if( timerId>0 && timerId<=FOSSIL_TIMER_COUNT ){
345345
struct FossilTimer * start = &fossilTimerList[timerId-1];
346346
if( !start->id ){
347
- fossil_fatal("Invalid call to reset a non-allocated "
347
+ fossil_panic("Invalid call to reset a non-allocated "
348348
"timer (#%d)", timerId);
349349
/*NOTREACHED*/
350350
}else{
351351
sqlite3_uint64 const rc = fossil_timer_fetch(timerId);
352352
fossil_cpu_times( &start->u, &start->s );
@@ -520,10 +520,10 @@
520520
** On all other platforms, this routine does not exist, but instead
521521
** a macro defined in config.h is used to provide a no-op.
522522
*/
523523
void fossil_pledge(const char *promises){
524524
if( pledge(promises, 0) ){
525
- fossil_fatal("pledge(\"%s\",NULL) fails with errno=%d",
525
+ fossil_panic("pledge(\"%s\",NULL) fails with errno=%d",
526526
promises, (int)errno);
527527
}
528528
}
529529
#endif /* defined(HAVE_PLEDGE) */
530530
--- src/util.c
+++ src/util.c
@@ -98,22 +98,22 @@
98 assert( pageSize>0 );
99 assert( pageSize%2==0 );
100 #if defined(_WIN32)
101 p = VirtualAlloc(NULL, pageSize, MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE);
102 if( p==NULL ){
103 fossil_fatal("VirtualAlloc failed: %lu\n", GetLastError());
104 }
105 if( !VirtualLock(p, pageSize) ){
106 fossil_fatal("VirtualLock failed: %lu\n", GetLastError());
107 }
108 #elif defined(USE_MMAN_H)
109 p = mmap(0, pageSize, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
110 if( p==MAP_FAILED ){
111 fossil_fatal("mmap failed: %d\n", errno);
112 }
113 if( mlock(p, pageSize) ){
114 fossil_fatal("mlock failed: %d\n", errno);
115 }
116 #else
117 p = fossil_malloc(pageSize);
118 #endif
119 fossil_secure_zero(p, pageSize);
@@ -124,21 +124,21 @@
124 if( !p ) return;
125 assert( n>0 );
126 fossil_secure_zero(p, n);
127 #if defined(_WIN32)
128 if( !VirtualUnlock(p, n) ){
129 fossil_fatal("VirtualUnlock failed: %lu\n", GetLastError());
130 }
131 if( !VirtualFree(p, 0, MEM_RELEASE) ){
132 fossil_fatal("VirtualFree failed: %lu\n", GetLastError());
133 }
134 #elif defined(USE_MMAN_H)
135 if( munlock(p, n) ){
136 fossil_fatal("munlock failed: %d\n", errno);
137 }
138 if( munmap(p, n) ){
139 fossil_fatal("munmap failed: %d\n", errno);
140 }
141 #else
142 fossil_free(p);
143 #endif
144 }
@@ -322,11 +322,11 @@
322 */
323 sqlite3_uint64 fossil_timer_fetch(int timerId){
324 if( timerId>0 && timerId<=FOSSIL_TIMER_COUNT ){
325 struct FossilTimer * start = &fossilTimerList[timerId-1];
326 if( !start->id ){
327 fossil_fatal("Invalid call to fetch a non-allocated "
328 "timer (#%d)", timerId);
329 /*NOTREACHED*/
330 }else{
331 sqlite3_uint64 eu = 0, es = 0;
332 fossil_cpu_times( &eu, &es );
@@ -342,11 +342,11 @@
342 */
343 sqlite3_uint64 fossil_timer_reset(int timerId){
344 if( timerId>0 && timerId<=FOSSIL_TIMER_COUNT ){
345 struct FossilTimer * start = &fossilTimerList[timerId-1];
346 if( !start->id ){
347 fossil_fatal("Invalid call to reset a non-allocated "
348 "timer (#%d)", timerId);
349 /*NOTREACHED*/
350 }else{
351 sqlite3_uint64 const rc = fossil_timer_fetch(timerId);
352 fossil_cpu_times( &start->u, &start->s );
@@ -520,10 +520,10 @@
520 ** On all other platforms, this routine does not exist, but instead
521 ** a macro defined in config.h is used to provide a no-op.
522 */
523 void fossil_pledge(const char *promises){
524 if( pledge(promises, 0) ){
525 fossil_fatal("pledge(\"%s\",NULL) fails with errno=%d",
526 promises, (int)errno);
527 }
528 }
529 #endif /* defined(HAVE_PLEDGE) */
530
--- src/util.c
+++ src/util.c
@@ -98,22 +98,22 @@
98 assert( pageSize>0 );
99 assert( pageSize%2==0 );
100 #if defined(_WIN32)
101 p = VirtualAlloc(NULL, pageSize, MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE);
102 if( p==NULL ){
103 fossil_panic("VirtualAlloc failed: %lu\n", GetLastError());
104 }
105 if( !VirtualLock(p, pageSize) ){
106 fossil_panic("VirtualLock failed: %lu\n", GetLastError());
107 }
108 #elif defined(USE_MMAN_H)
109 p = mmap(0, pageSize, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
110 if( p==MAP_FAILED ){
111 fossil_panic("mmap failed: %d\n", errno);
112 }
113 if( mlock(p, pageSize) ){
114 fossil_panic("mlock failed: %d\n", errno);
115 }
116 #else
117 p = fossil_malloc(pageSize);
118 #endif
119 fossil_secure_zero(p, pageSize);
@@ -124,21 +124,21 @@
124 if( !p ) return;
125 assert( n>0 );
126 fossil_secure_zero(p, n);
127 #if defined(_WIN32)
128 if( !VirtualUnlock(p, n) ){
129 fossil_panic("VirtualUnlock failed: %lu\n", GetLastError());
130 }
131 if( !VirtualFree(p, 0, MEM_RELEASE) ){
132 fossil_panic("VirtualFree failed: %lu\n", GetLastError());
133 }
134 #elif defined(USE_MMAN_H)
135 if( munlock(p, n) ){
136 fossil_panic("munlock failed: %d\n", errno);
137 }
138 if( munmap(p, n) ){
139 fossil_panic("munmap failed: %d\n", errno);
140 }
141 #else
142 fossil_free(p);
143 #endif
144 }
@@ -322,11 +322,11 @@
322 */
323 sqlite3_uint64 fossil_timer_fetch(int timerId){
324 if( timerId>0 && timerId<=FOSSIL_TIMER_COUNT ){
325 struct FossilTimer * start = &fossilTimerList[timerId-1];
326 if( !start->id ){
327 fossil_panic("Invalid call to fetch a non-allocated "
328 "timer (#%d)", timerId);
329 /*NOTREACHED*/
330 }else{
331 sqlite3_uint64 eu = 0, es = 0;
332 fossil_cpu_times( &eu, &es );
@@ -342,11 +342,11 @@
342 */
343 sqlite3_uint64 fossil_timer_reset(int timerId){
344 if( timerId>0 && timerId<=FOSSIL_TIMER_COUNT ){
345 struct FossilTimer * start = &fossilTimerList[timerId-1];
346 if( !start->id ){
347 fossil_panic("Invalid call to reset a non-allocated "
348 "timer (#%d)", timerId);
349 /*NOTREACHED*/
350 }else{
351 sqlite3_uint64 const rc = fossil_timer_fetch(timerId);
352 fossil_cpu_times( &start->u, &start->s );
@@ -520,10 +520,10 @@
520 ** On all other platforms, this routine does not exist, but instead
521 ** a macro defined in config.h is used to provide a no-op.
522 */
523 void fossil_pledge(const char *promises){
524 if( pledge(promises, 0) ){
525 fossil_panic("pledge(\"%s\",NULL) fails with errno=%d",
526 promises, (int)errno);
527 }
528 }
529 #endif /* defined(HAVE_PLEDGE) */
530
+1 -1
--- src/verify.c
+++ src/verify.c
@@ -45,11 +45,11 @@
4545
if( !hname_validate(blob_buffer(&uuid), blob_size(&uuid)) ){
4646
fossil_fatal("not a valid rid: %d", rid);
4747
}
4848
if( content_get(rid, &content) ){
4949
if( !hname_verify_hash(&content, blob_buffer(&uuid), blob_size(&uuid)) ){
50
- fossil_fatal("hash of rid %d does not match its uuid (%b)",
50
+ fossil_panic("hash of rid %d does not match its uuid (%b)",
5151
rid, &uuid);
5252
}
5353
blob_reset(&content);
5454
}
5555
blob_reset(&uuid);
5656
--- src/verify.c
+++ src/verify.c
@@ -45,11 +45,11 @@
45 if( !hname_validate(blob_buffer(&uuid), blob_size(&uuid)) ){
46 fossil_fatal("not a valid rid: %d", rid);
47 }
48 if( content_get(rid, &content) ){
49 if( !hname_verify_hash(&content, blob_buffer(&uuid), blob_size(&uuid)) ){
50 fossil_fatal("hash of rid %d does not match its uuid (%b)",
51 rid, &uuid);
52 }
53 blob_reset(&content);
54 }
55 blob_reset(&uuid);
56
--- src/verify.c
+++ src/verify.c
@@ -45,11 +45,11 @@
45 if( !hname_validate(blob_buffer(&uuid), blob_size(&uuid)) ){
46 fossil_fatal("not a valid rid: %d", rid);
47 }
48 if( content_get(rid, &content) ){
49 if( !hname_verify_hash(&content, blob_buffer(&uuid), blob_size(&uuid)) ){
50 fossil_panic("hash of rid %d does not match its uuid (%b)",
51 rid, &uuid);
52 }
53 blob_reset(&content);
54 }
55 blob_reset(&uuid);
56
+1 -1
--- src/winfile.c
+++ src/winfile.c
@@ -282,11 +282,11 @@
282282
void win32_getcwd(char *zBuf, int nBuf){
283283
int i;
284284
char *zUtf8;
285285
wchar_t *zWide = fossil_malloc( sizeof(wchar_t)*nBuf );
286286
if( GetCurrentDirectoryW(nBuf, zWide)==0 ){
287
- fossil_fatal("cannot find current working directory.");
287
+ fossil_panic("cannot find current working directory.");
288288
}
289289
zUtf8 = fossil_path_to_utf8(zWide);
290290
fossil_free(zWide);
291291
for(i=0; zUtf8[i]; i++) if( zUtf8[i]=='\\' ) zUtf8[i] = '/';
292292
strncpy(zBuf, zUtf8, nBuf);
293293
--- src/winfile.c
+++ src/winfile.c
@@ -282,11 +282,11 @@
282 void win32_getcwd(char *zBuf, int nBuf){
283 int i;
284 char *zUtf8;
285 wchar_t *zWide = fossil_malloc( sizeof(wchar_t)*nBuf );
286 if( GetCurrentDirectoryW(nBuf, zWide)==0 ){
287 fossil_fatal("cannot find current working directory.");
288 }
289 zUtf8 = fossil_path_to_utf8(zWide);
290 fossil_free(zWide);
291 for(i=0; zUtf8[i]; i++) if( zUtf8[i]=='\\' ) zUtf8[i] = '/';
292 strncpy(zBuf, zUtf8, nBuf);
293
--- src/winfile.c
+++ src/winfile.c
@@ -282,11 +282,11 @@
282 void win32_getcwd(char *zBuf, int nBuf){
283 int i;
284 char *zUtf8;
285 wchar_t *zWide = fossil_malloc( sizeof(wchar_t)*nBuf );
286 if( GetCurrentDirectoryW(nBuf, zWide)==0 ){
287 fossil_panic("cannot find current working directory.");
288 }
289 zUtf8 = fossil_path_to_utf8(zWide);
290 fossil_free(zWide);
291 for(i=0; zUtf8[i]; i++) if( zUtf8[i]=='\\' ) zUtf8[i] = '/';
292 strncpy(zBuf, zUtf8, nBuf);
293
+8 -8
--- src/winhttp.c
+++ src/winhttp.c
@@ -284,11 +284,11 @@
284284
static NORETURN void winhttp_fatal(
285285
const char *zOp,
286286
const char *zService,
287287
const char *zErr
288288
){
289
- fossil_fatal("unable to %s service '%s': %s", zOp, zService, zErr);
289
+ fossil_panic("unable to %s service '%s': %s", zOp, zService, zErr);
290290
}
291291
292292
/*
293293
** Make sure the server stops as soon as possible after the stopper file
294294
** is found. If there is no stopper file name, do nothing.
@@ -560,11 +560,11 @@
560560
blob_appendf(&options, " --usepidkey %lu:%p:%u", GetCurrentProcessId(),
561561
zSavedKey, savedKeySize);
562562
}
563563
#endif
564564
if( WSAStartup(MAKEWORD(2,0), &wd) ){
565
- fossil_fatal("unable to initialize winsock");
565
+ fossil_panic("unable to initialize winsock");
566566
}
567567
DualSocket_init(&ds);
568568
while( iPort<=mxPort ){
569569
if( zIpAddr ){
570570
if( DualSocket_listen(&ds, zIpAddr, iPort)==0 ){
@@ -582,18 +582,18 @@
582582
}
583583
break;
584584
}
585585
if( iPort>mxPort ){
586586
if( mnPort==mxPort ){
587
- fossil_fatal("unable to open listening socket on port %d", mnPort);
587
+ fossil_panic("unable to open listening socket on port %d", mnPort);
588588
}else{
589
- fossil_fatal("unable to open listening socket on any"
589
+ fossil_panic("unable to open listening socket on any"
590590
" port in the range %d..%d", mnPort, mxPort);
591591
}
592592
}
593593
if( !GetTempPathW(MAX_PATH, zTmpPath) ){
594
- fossil_fatal("unable to get path to the temporary directory.");
594
+ fossil_panic("unable to get path to the temporary directory.");
595595
}
596596
zTempPrefix = mprintf("%sfossil_server_P%d",
597597
fossil_unicode_to_utf8(zTmpPath), iPort);
598598
fossil_print("Temporary files: %s*\n", zTempPrefix);
599599
fossil_print("Listening for %s requests on TCP port %d\n",
@@ -640,11 +640,11 @@
640640
if( (wsaError==WSAEINTR) || (wsaError==WSAENOTSOCK) ){
641641
WSACleanup();
642642
return;
643643
}else{
644644
WSACleanup();
645
- fossil_fatal("error from accept()");
645
+ fossil_panic("error from accept()");
646646
}
647647
}
648648
if( client.s4!=INVALID_SOCKET ){
649649
pRequest = fossil_malloc(sizeof(HttpRequest));
650650
pRequest->id = ++idCnt;
@@ -740,11 +740,11 @@
740740
);
741741
}
742742
if( nMsg ){
743743
zMsg = fossil_unicode_to_utf8(tmp);
744744
}else{
745
- fossil_fatal("unable to get system error message.");
745
+ fossil_panic("unable to get system error message.");
746746
}
747747
if( tmp ){
748748
LocalFree((HLOCAL) tmp);
749749
}
750750
return zMsg;
@@ -885,11 +885,11 @@
885885
/* Try to start the control dispatcher thread for the service. */
886886
if( !StartServiceCtrlDispatcherW(ServiceTable) ){
887887
if( GetLastError()==ERROR_FAILED_SERVICE_CONTROLLER_CONNECT ){
888888
return 1;
889889
}else{
890
- fossil_fatal("error from StartServiceCtrlDispatcher()");
890
+ fossil_panic("error from StartServiceCtrlDispatcher()");
891891
}
892892
}
893893
return 0;
894894
}
895895
896896
--- src/winhttp.c
+++ src/winhttp.c
@@ -284,11 +284,11 @@
284 static NORETURN void winhttp_fatal(
285 const char *zOp,
286 const char *zService,
287 const char *zErr
288 ){
289 fossil_fatal("unable to %s service '%s': %s", zOp, zService, zErr);
290 }
291
292 /*
293 ** Make sure the server stops as soon as possible after the stopper file
294 ** is found. If there is no stopper file name, do nothing.
@@ -560,11 +560,11 @@
560 blob_appendf(&options, " --usepidkey %lu:%p:%u", GetCurrentProcessId(),
561 zSavedKey, savedKeySize);
562 }
563 #endif
564 if( WSAStartup(MAKEWORD(2,0), &wd) ){
565 fossil_fatal("unable to initialize winsock");
566 }
567 DualSocket_init(&ds);
568 while( iPort<=mxPort ){
569 if( zIpAddr ){
570 if( DualSocket_listen(&ds, zIpAddr, iPort)==0 ){
@@ -582,18 +582,18 @@
582 }
583 break;
584 }
585 if( iPort>mxPort ){
586 if( mnPort==mxPort ){
587 fossil_fatal("unable to open listening socket on port %d", mnPort);
588 }else{
589 fossil_fatal("unable to open listening socket on any"
590 " port in the range %d..%d", mnPort, mxPort);
591 }
592 }
593 if( !GetTempPathW(MAX_PATH, zTmpPath) ){
594 fossil_fatal("unable to get path to the temporary directory.");
595 }
596 zTempPrefix = mprintf("%sfossil_server_P%d",
597 fossil_unicode_to_utf8(zTmpPath), iPort);
598 fossil_print("Temporary files: %s*\n", zTempPrefix);
599 fossil_print("Listening for %s requests on TCP port %d\n",
@@ -640,11 +640,11 @@
640 if( (wsaError==WSAEINTR) || (wsaError==WSAENOTSOCK) ){
641 WSACleanup();
642 return;
643 }else{
644 WSACleanup();
645 fossil_fatal("error from accept()");
646 }
647 }
648 if( client.s4!=INVALID_SOCKET ){
649 pRequest = fossil_malloc(sizeof(HttpRequest));
650 pRequest->id = ++idCnt;
@@ -740,11 +740,11 @@
740 );
741 }
742 if( nMsg ){
743 zMsg = fossil_unicode_to_utf8(tmp);
744 }else{
745 fossil_fatal("unable to get system error message.");
746 }
747 if( tmp ){
748 LocalFree((HLOCAL) tmp);
749 }
750 return zMsg;
@@ -885,11 +885,11 @@
885 /* Try to start the control dispatcher thread for the service. */
886 if( !StartServiceCtrlDispatcherW(ServiceTable) ){
887 if( GetLastError()==ERROR_FAILED_SERVICE_CONTROLLER_CONNECT ){
888 return 1;
889 }else{
890 fossil_fatal("error from StartServiceCtrlDispatcher()");
891 }
892 }
893 return 0;
894 }
895
896
--- src/winhttp.c
+++ src/winhttp.c
@@ -284,11 +284,11 @@
284 static NORETURN void winhttp_fatal(
285 const char *zOp,
286 const char *zService,
287 const char *zErr
288 ){
289 fossil_panic("unable to %s service '%s': %s", zOp, zService, zErr);
290 }
291
292 /*
293 ** Make sure the server stops as soon as possible after the stopper file
294 ** is found. If there is no stopper file name, do nothing.
@@ -560,11 +560,11 @@
560 blob_appendf(&options, " --usepidkey %lu:%p:%u", GetCurrentProcessId(),
561 zSavedKey, savedKeySize);
562 }
563 #endif
564 if( WSAStartup(MAKEWORD(2,0), &wd) ){
565 fossil_panic("unable to initialize winsock");
566 }
567 DualSocket_init(&ds);
568 while( iPort<=mxPort ){
569 if( zIpAddr ){
570 if( DualSocket_listen(&ds, zIpAddr, iPort)==0 ){
@@ -582,18 +582,18 @@
582 }
583 break;
584 }
585 if( iPort>mxPort ){
586 if( mnPort==mxPort ){
587 fossil_panic("unable to open listening socket on port %d", mnPort);
588 }else{
589 fossil_panic("unable to open listening socket on any"
590 " port in the range %d..%d", mnPort, mxPort);
591 }
592 }
593 if( !GetTempPathW(MAX_PATH, zTmpPath) ){
594 fossil_panic("unable to get path to the temporary directory.");
595 }
596 zTempPrefix = mprintf("%sfossil_server_P%d",
597 fossil_unicode_to_utf8(zTmpPath), iPort);
598 fossil_print("Temporary files: %s*\n", zTempPrefix);
599 fossil_print("Listening for %s requests on TCP port %d\n",
@@ -640,11 +640,11 @@
640 if( (wsaError==WSAEINTR) || (wsaError==WSAENOTSOCK) ){
641 WSACleanup();
642 return;
643 }else{
644 WSACleanup();
645 fossil_panic("error from accept()");
646 }
647 }
648 if( client.s4!=INVALID_SOCKET ){
649 pRequest = fossil_malloc(sizeof(HttpRequest));
650 pRequest->id = ++idCnt;
@@ -740,11 +740,11 @@
740 );
741 }
742 if( nMsg ){
743 zMsg = fossil_unicode_to_utf8(tmp);
744 }else{
745 fossil_panic("unable to get system error message.");
746 }
747 if( tmp ){
748 LocalFree((HLOCAL) tmp);
749 }
750 return zMsg;
@@ -885,11 +885,11 @@
885 /* Try to start the control dispatcher thread for the service. */
886 if( !StartServiceCtrlDispatcherW(ServiceTable) ){
887 if( GetLastError()==ERROR_FAILED_SERVICE_CONTROLLER_CONNECT ){
888 return 1;
889 }else{
890 fossil_panic("error from StartServiceCtrlDispatcher()");
891 }
892 }
893 return 0;
894 }
895
896

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button