Skip to content

Commit 21bf1c6

Browse files
committed
sequence exit codes, update .gitginore
The result of `make release` updated exit codes in `chkentry.c` and `jparse/util.c`. We put back into `.gitignore`, `/test_ioccc/slot/good/workdir/` since everything under that directory will be built instead of checked in to this repo.
1 parent 689de2d commit 21bf1c6

File tree

3 files changed

+327
-326
lines changed

3 files changed

+327
-326
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ random_answers.*
4444
/test_ioccc/fnamchk
4545
/test_ioccc/.hostchk.*.work/
4646
/test_ioccc/.local.dir.tags
47+
/test_ioccc/slot/good/workdir/
4748
/test_ioccc/tags
4849
/test_ioccc/test_JSON/
4950
/test_ioccc/test_ioccc.log

chkentry.c

+26-26
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ main(int argc, char *argv[])
836836
++all_extra_err_count;
837837
}
838838
if (is_empty(u)) {
839-
werr(1, __func__, "%s: file is empty", u);
839+
werr(61, __func__, "%s: file is empty", u);
840840
++all_extra_err_count;
841841
}
842842

@@ -865,7 +865,7 @@ main(int argc, char *argv[])
865865
++all_extra_err_count;
866866
}
867867
if (is_empty(u)) {
868-
werr(1, __func__, "%s: file is empty", u);
868+
werr(62, __func__, "%s: file is empty", u);
869869
++all_extra_err_count;
870870
}
871871
found_entry = true;
@@ -878,7 +878,7 @@ main(int argc, char *argv[])
878878
++all_extra_err_count;
879879
}
880880
if (is_empty(u)) {
881-
werr(1, __func__, "%s: file is empty", u);
881+
werr(63, __func__, "%s: file is empty", u);
882882
++all_extra_err_count;
883883
}
884884
found_README = true;
@@ -891,7 +891,7 @@ main(int argc, char *argv[])
891891
++all_extra_err_count;
892892
}
893893
if (is_empty(u)) {
894-
werr(1, __func__, "%s: file is empty", u);
894+
werr(64, __func__, "%s: file is empty", u);
895895
++all_extra_err_count;
896896
}
897897
found_index = true;
@@ -1020,7 +1020,7 @@ main(int argc, char *argv[])
10201020
for (c = 0; c < len; ++c) {
10211021
u = dyn_array_value(found, char *, c);
10221022
if (u == NULL) {
1023-
err(61, __func__, "NULL pointer in found files list");
1023+
err(65, __func__, "NULL pointer in found files list");
10241024
not_reached();
10251025
}
10261026
/*
@@ -1037,7 +1037,7 @@ main(int argc, char *argv[])
10371037
++all_extra_err_count;
10381038
}
10391039
if (is_empty(u)) {
1040-
werr(1, __func__, "%s: file is empty", u);
1040+
werr(66, __func__, "%s: file is empty", u);
10411041
++all_extra_err_count;
10421042
}
10431043
found_auth = true;
@@ -1050,7 +1050,7 @@ main(int argc, char *argv[])
10501050
++all_extra_err_count;
10511051
}
10521052
if (is_empty(u)) {
1053-
werr(1, __func__, "%s: file is empty", u);
1053+
werr(67, __func__, "%s: file is empty", u);
10541054
++all_extra_err_count;
10551055
}
10561056
found_info = true;
@@ -1063,7 +1063,7 @@ main(int argc, char *argv[])
10631063
++all_extra_err_count;
10641064
}
10651065
if (is_empty(u)) {
1066-
werr(1, __func__, "%s: file is empty", u);
1066+
werr(68, __func__, "%s: file is empty", u);
10671067
++all_extra_err_count;
10681068
}
10691069
found_remarks = true;
@@ -1076,7 +1076,7 @@ main(int argc, char *argv[])
10761076
++all_extra_err_count;
10771077
}
10781078
if (is_empty(u)) {
1079-
werr(1, __func__, "%s: file is empty", u);
1079+
werr(69, __func__, "%s: file is empty", u);
10801080
++all_extra_err_count;
10811081
}
10821082
found_Makefile = true;
@@ -1201,7 +1201,7 @@ main(int argc, char *argv[])
12011201
*/
12021202
errno = 0; /* pre-clear errno for errp() */
12031203
if (fchdir(cwd2) != 0) {
1204-
errp(62, __func__, "failed to change back to original directory");
1204+
errp(70, __func__, "failed to change back to original directory");
12051205
not_reached();
12061206
}
12071207

@@ -1212,12 +1212,12 @@ main(int argc, char *argv[])
12121212
auth_filename = ".auth.json";
12131213
auth_stream = open_dir_file(*submission_dir, auth_filename);
12141214
if (auth_stream == NULL) { /* paranoia */
1215-
err(63, __func__, "auth_stream = open_dir_file(%s, %s) returned NULL", *submission_dir, auth_filename);
1215+
err(71, __func__, "auth_stream = open_dir_file(%s, %s) returned NULL", *submission_dir, auth_filename);
12161216
not_reached();
12171217
}
12181218
auth_path = calloc_path(*submission_dir, auth_filename);
12191219
if (auth_path == NULL) {
1220-
err(64, __func__, "auth_path is NULL");
1220+
err(72, __func__, "auth_path is NULL");
12211221
not_reached();
12221222
}
12231223
}
@@ -1229,12 +1229,12 @@ main(int argc, char *argv[])
12291229
info_filename = ".info.json";
12301230
info_stream = open_dir_file(*submission_dir, info_filename);
12311231
if (info_stream == NULL) { /* paranoia */
1232-
err(65, __func__, "info_stream = open_dir_file(%s, %s) returned NULL", *submission_dir, info_filename);
1232+
err(73, __func__, "info_stream = open_dir_file(%s, %s) returned NULL", *submission_dir, info_filename);
12331233
not_reached();
12341234
}
12351235
info_path = calloc_path(*submission_dir, info_filename);
12361236
if (info_path == NULL) {
1237-
err(66, __func__, "info_path is NULL");
1237+
err(74, __func__, "info_path is NULL");
12381238
not_reached();
12391239
}
12401240
}
@@ -1279,27 +1279,27 @@ main(int argc, char *argv[])
12791279
* firewall on json_sem_check() results AND count errors for .auth.json
12801280
*/
12811281
if (auth_count_err == NULL) {
1282-
err(67, __func__, "json_sem_check() left auth_count_err as NULL for .auth.json file: %s", auth_path);
1282+
err(75, __func__, "json_sem_check() left auth_count_err as NULL for .auth.json file: %s", auth_path);
12831283
not_reached();
12841284
}
12851285
if (dyn_array_tell(auth_count_err) < 0) {
1286-
err(68, __func__, "dyn_array_tell(auth_count_err): %jd < 0 "
1286+
err(76, __func__, "dyn_array_tell(auth_count_err): %jd < 0 "
12871287
"for .auth.json file: %s", dyn_array_tell(auth_count_err), auth_path);
12881288
not_reached();
12891289
}
12901290
auth_count_err_count = (uintmax_t) dyn_array_tell(auth_count_err);
12911291
if (auth_val_err == NULL) {
1292-
err(69, __func__, "json_sem_check() left auth_val_err as NULL for .auth.json file: %s", auth_path);
1292+
err(77, __func__, "json_sem_check() left auth_val_err as NULL for .auth.json file: %s", auth_path);
12931293
not_reached();
12941294
}
12951295
if (dyn_array_tell(auth_val_err) < 0) {
1296-
err(70, __func__, "dyn_array_tell(auth_val_err): %jd < 0 "
1296+
err(78, __func__, "dyn_array_tell(auth_val_err): %jd < 0 "
12971297
"for .auth.json file: %s", dyn_array_tell(auth_val_err), auth_path);
12981298
not_reached();
12991299
}
13001300
auth_val_err_count = (uintmax_t)dyn_array_tell(auth_val_err);
13011301
if (auth_all_err_count < auth_count_err_count+auth_val_err_count) {
1302-
err(71, __func__, "auth_all_err_count: %ju < auth_count_err_count: %ju + auth_val_err_count: %ju "
1302+
err(79, __func__, "auth_all_err_count: %ju < auth_count_err_count: %ju + auth_val_err_count: %ju "
13031303
"for .auth.json file: %s",
13041304
auth_all_err_count, auth_count_err_count, auth_val_err_count, auth_path);
13051305
not_reached();
@@ -1323,29 +1323,29 @@ main(int argc, char *argv[])
13231323
* firewall on json_sem_check() results AND count errors for .info.json
13241324
*/
13251325
if (info_count_err == NULL) {
1326-
err(72, __func__, "json_sem_check() left info_count_err as NULL for .info.json file: %s", info_path);
1326+
err(80, __func__, "json_sem_check() left info_count_err as NULL for .info.json file: %s", info_path);
13271327
not_reached();
13281328
}
13291329
if (dyn_array_tell(info_count_err) < 0) {
1330-
err(73, __func__, "dyn_array_tell(info_count_err): %jd < 0 "
1330+
err(81, __func__, "dyn_array_tell(info_count_err): %jd < 0 "
13311331
"for .info.json file: %s",
13321332
dyn_array_tell(info_count_err), info_path);
13331333
not_reached();
13341334
}
13351335
info_count_err_count = (uintmax_t)dyn_array_tell(info_count_err);
13361336
if (info_val_err == NULL) {
1337-
err(74, __func__, "json_sem_check() left info_val_err as NULL for .info.json file: %s", info_path);
1337+
err(82, __func__, "json_sem_check() left info_val_err as NULL for .info.json file: %s", info_path);
13381338
not_reached();
13391339
}
13401340
if (dyn_array_tell(info_val_err) < 0) {
1341-
err(75, __func__, "dyn_array_tell(info_val_err): %jd < 0 "
1341+
err(83, __func__, "dyn_array_tell(info_val_err): %jd < 0 "
13421342
"for .info.json file: %ss",
13431343
dyn_array_tell(info_val_err), info_path);
13441344
not_reached();
13451345
}
13461346
info_val_err_count = (uintmax_t)dyn_array_tell(info_val_err);
13471347
if (info_all_err_count < info_count_err_count+info_val_err_count) {
1348-
err(76, __func__, "info_all_err_count: %ju < info_count_err_count: %ju + info_val_err_count: %ju "
1348+
err(84, __func__, "info_all_err_count: %ju < info_count_err_count: %ju + info_val_err_count: %ju "
13491349
"for .info.json file: %s",
13501350
info_all_err_count, info_count_err_count, info_val_err_count, info_path);
13511351
not_reached();
@@ -1530,7 +1530,7 @@ main(int argc, char *argv[])
15301530
*/
15311531
errno = 0; /* pre-clear errno for errp() */
15321532
if (fchdir(cwd2) != 0) {
1533-
errp(77, __func__, "failed to change back to previous directory");
1533+
errp(85, __func__, "failed to change back to previous directory");
15341534
not_reached();
15351535
}
15361536
/*
@@ -1541,7 +1541,7 @@ main(int argc, char *argv[])
15411541
*/
15421542
errno = 0; /* pre-clear errno for errp */
15431543
if (close(cwd2) != 0) {
1544-
errp(78, __func__, "failed to close original directory FD");
1544+
errp(86, __func__, "failed to close original directory FD");
15451545
not_reached();
15461546
}
15471547
/*

0 commit comments

Comments
 (0)