Remove == TRUE' tests and convert != TRUE' and `== FALSE' tests to use !.

This commit is contained in:
Matt Kraai 2001-12-20 23:13:26 +00:00
parent 31c73af656
commit 1f0c43668a
27 changed files with 144 additions and 144 deletions

View File

@ -626,7 +626,7 @@ int BZ2_decompress(DState *s)
switch (switch_val) { switch (switch_val) {
case BZ_X_MAGIC_1: case BZ_X_MAGIC_1:
s->state = BZ_X_MAGIC_1; s->state = BZ_X_MAGIC_1;
if (get_bits(s, &uc, 8) == FALSE) { if (! get_bits(s, &uc, 8)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -637,7 +637,7 @@ int BZ2_decompress(DState *s)
case BZ_X_MAGIC_2: case BZ_X_MAGIC_2:
s->state = BZ_X_MAGIC_2; s->state = BZ_X_MAGIC_2;
if (get_bits(s, &uc, 8) == FALSE) { if (! get_bits(s, &uc, 8)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -648,7 +648,7 @@ int BZ2_decompress(DState *s)
case BZ_X_MAGIC_3: case BZ_X_MAGIC_3:
s->state = BZ_X_MAGIC_3; s->state = BZ_X_MAGIC_3;
if (get_bits(s, &uc, 8) == FALSE) { if (! get_bits(s, &uc, 8)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -659,7 +659,7 @@ int BZ2_decompress(DState *s)
case BZ_X_MAGIC_4: case BZ_X_MAGIC_4:
s->state = BZ_X_MAGIC_4; s->state = BZ_X_MAGIC_4;
if (get_bits(s, &s->blockSize100k, 8) == FALSE) { if (! get_bits(s, &s->blockSize100k, 8)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -687,7 +687,7 @@ int BZ2_decompress(DState *s)
case BZ_X_BLKHDR_1: case BZ_X_BLKHDR_1:
s->state = BZ_X_BLKHDR_1; s->state = BZ_X_BLKHDR_1;
if (get_bits(s, &uc, 8) == FALSE) { if (! get_bits(s, &uc, 8)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -702,7 +702,7 @@ int BZ2_decompress(DState *s)
case BZ_X_BLKHDR_2: case BZ_X_BLKHDR_2:
s->state = BZ_X_BLKHDR_2; s->state = BZ_X_BLKHDR_2;
if (get_bits(s, &uc, 8) == FALSE) { if (! get_bits(s, &uc, 8)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -713,7 +713,7 @@ int BZ2_decompress(DState *s)
case BZ_X_BLKHDR_3: case BZ_X_BLKHDR_3:
s->state = BZ_X_BLKHDR_3; s->state = BZ_X_BLKHDR_3;
if (get_bits(s, &uc, 8) == FALSE) { if (! get_bits(s, &uc, 8)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -724,7 +724,7 @@ int BZ2_decompress(DState *s)
case BZ_X_BLKHDR_4: case BZ_X_BLKHDR_4:
s->state = BZ_X_BLKHDR_4; s->state = BZ_X_BLKHDR_4;
if (get_bits(s, &uc, 8) == FALSE) { if (! get_bits(s, &uc, 8)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -735,7 +735,7 @@ int BZ2_decompress(DState *s)
case BZ_X_BLKHDR_5: case BZ_X_BLKHDR_5:
s->state = BZ_X_BLKHDR_5; s->state = BZ_X_BLKHDR_5;
if (get_bits(s, &uc, 8) == FALSE) { if (! get_bits(s, &uc, 8)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -746,7 +746,7 @@ int BZ2_decompress(DState *s)
case BZ_X_BLKHDR_6: case BZ_X_BLKHDR_6:
s->state = BZ_X_BLKHDR_6; s->state = BZ_X_BLKHDR_6;
if (get_bits(s, &uc, 8) == FALSE) { if (! get_bits(s, &uc, 8)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -763,7 +763,7 @@ int BZ2_decompress(DState *s)
case BZ_X_BCRC_1: case BZ_X_BCRC_1:
s->state = BZ_X_BCRC_1; s->state = BZ_X_BCRC_1;
if (get_bits(s, &uc, 8) == FALSE) { if (! get_bits(s, &uc, 8)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -771,7 +771,7 @@ int BZ2_decompress(DState *s)
case BZ_X_BCRC_2: case BZ_X_BCRC_2:
s->state = BZ_X_BCRC_2; s->state = BZ_X_BCRC_2;
if (get_bits(s, &uc, 8) == FALSE) { if (! get_bits(s, &uc, 8)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -779,7 +779,7 @@ int BZ2_decompress(DState *s)
case BZ_X_BCRC_3: case BZ_X_BCRC_3:
s->state = BZ_X_BCRC_3; s->state = BZ_X_BCRC_3;
if (get_bits(s, &uc, 8) == FALSE) { if (! get_bits(s, &uc, 8)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -787,7 +787,7 @@ int BZ2_decompress(DState *s)
case BZ_X_BCRC_4: case BZ_X_BCRC_4:
s->state = BZ_X_BCRC_4; s->state = BZ_X_BCRC_4;
if (get_bits(s, &uc, 8) == FALSE) { if (! get_bits(s, &uc, 8)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -799,7 +799,7 @@ int BZ2_decompress(DState *s)
int tmp = s->blockRandomised; int tmp = s->blockRandomised;
const int ret = get_bits(s, &tmp, 1); const int ret = get_bits(s, &tmp, 1);
s->blockRandomised = tmp; s->blockRandomised = tmp;
if (ret == FALSE) { if (! ret) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -809,7 +809,7 @@ int BZ2_decompress(DState *s)
case BZ_X_ORIGPTR_1: case BZ_X_ORIGPTR_1:
s->state = BZ_X_ORIGPTR_1; s->state = BZ_X_ORIGPTR_1;
if (get_bits(s, &uc, 8) == FALSE) { if (! get_bits(s, &uc, 8)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -817,7 +817,7 @@ int BZ2_decompress(DState *s)
case BZ_X_ORIGPTR_2: case BZ_X_ORIGPTR_2:
s->state = BZ_X_ORIGPTR_2; s->state = BZ_X_ORIGPTR_2;
if (get_bits(s, &uc, 8) == FALSE) { if (! get_bits(s, &uc, 8)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -825,7 +825,7 @@ int BZ2_decompress(DState *s)
case BZ_X_ORIGPTR_3: case BZ_X_ORIGPTR_3:
s->state = BZ_X_ORIGPTR_3; s->state = BZ_X_ORIGPTR_3;
if (get_bits(s, &uc, 8) == FALSE) { if (! get_bits(s, &uc, 8)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -844,7 +844,7 @@ int BZ2_decompress(DState *s)
case BZ_X_MAPPING_1: case BZ_X_MAPPING_1:
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
s->state = BZ_X_MAPPING_1; s->state = BZ_X_MAPPING_1;
if (get_bits(s, &uc, 1) == FALSE) { if (! get_bits(s, &uc, 1)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -864,7 +864,7 @@ int BZ2_decompress(DState *s)
for (j = 0; j < 16; j++) { for (j = 0; j < 16; j++) {
case BZ_X_MAPPING_2: case BZ_X_MAPPING_2:
s->state = BZ_X_MAPPING_2; s->state = BZ_X_MAPPING_2;
if (get_bits(s, &uc, 1) == FALSE) { if (! get_bits(s, &uc, 1)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -891,7 +891,7 @@ int BZ2_decompress(DState *s)
/*--- Now the selectors ---*/ /*--- Now the selectors ---*/
case BZ_X_SELECTOR_1: case BZ_X_SELECTOR_1:
s->state = BZ_X_SELECTOR_1; s->state = BZ_X_SELECTOR_1;
if (get_bits(s, &nGroups, 3) == FALSE) { if (! get_bits(s, &nGroups, 3)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -902,7 +902,7 @@ int BZ2_decompress(DState *s)
case BZ_X_SELECTOR_2: case BZ_X_SELECTOR_2:
s->state = BZ_X_SELECTOR_2; s->state = BZ_X_SELECTOR_2;
if (get_bits(s, &nSelectors, 15) == FALSE) { if (! get_bits(s, &nSelectors, 15)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -918,7 +918,7 @@ int BZ2_decompress(DState *s)
while (1) { while (1) {
case BZ_X_SELECTOR_3: case BZ_X_SELECTOR_3:
s->state = BZ_X_SELECTOR_3; s->state = BZ_X_SELECTOR_3;
if (get_bits(s, &uc, 1) == FALSE) { if (! get_bits(s, &uc, 1)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -956,7 +956,7 @@ int BZ2_decompress(DState *s)
for (t = 0; t < nGroups; t++) { for (t = 0; t < nGroups; t++) {
case BZ_X_CODING_1: case BZ_X_CODING_1:
s->state = BZ_X_CODING_1; s->state = BZ_X_CODING_1;
if (get_bits(s, &curr, 5) == FALSE) { if (! get_bits(s, &curr, 5)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -969,7 +969,7 @@ int BZ2_decompress(DState *s)
case BZ_X_CODING_2: case BZ_X_CODING_2:
s->state = BZ_X_CODING_2; s->state = BZ_X_CODING_2;
if (get_bits(s, &uc, 1) == FALSE) { if (! get_bits(s, &uc, 1)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -979,7 +979,7 @@ int BZ2_decompress(DState *s)
case BZ_X_CODING_3: case BZ_X_CODING_3:
s->state = BZ_X_CODING_3; s->state = BZ_X_CODING_3;
if (get_bits(s, &uc, 1) == FALSE) { if (! get_bits(s, &uc, 1)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -1044,12 +1044,12 @@ int BZ2_decompress(DState *s)
nblock = 0; nblock = 0;
if (get_mtf_val_init() == FALSE) { if (! get_mtf_val_init()) {
goto save_state_and_return; goto save_state_and_return;
} }
case BZ_X_MTF_1: case BZ_X_MTF_1:
s->state = BZ_X_MTF_1; s->state = BZ_X_MTF_1;
if (get_bits(s, &zvec, zn) == FALSE) { if (! get_bits(s, &zvec, zn)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -1065,7 +1065,7 @@ int BZ2_decompress(DState *s)
case BZ_X_MTF_2: case BZ_X_MTF_2:
s->state = BZ_X_MTF_2; s->state = BZ_X_MTF_2;
if (get_bits(s, &zj, 1) == FALSE) { if (! get_bits(s, &zj, 1)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -1094,12 +1094,12 @@ int BZ2_decompress(DState *s)
} }
} }
N = N * 2; N = N * 2;
if (get_mtf_val_init() == FALSE) { if (! get_mtf_val_init()) {
goto save_state_and_return; goto save_state_and_return;
} }
case BZ_X_MTF_3: case BZ_X_MTF_3:
s->state = BZ_X_MTF_3; s->state = BZ_X_MTF_3;
if (get_bits(s, &zvec, zn) == FALSE) { if (! get_bits(s, &zvec, zn)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -1115,7 +1115,7 @@ int BZ2_decompress(DState *s)
case BZ_X_MTF_4: case BZ_X_MTF_4:
s->state = BZ_X_MTF_4; s->state = BZ_X_MTF_4;
if (get_bits(s, &zj, 1) == FALSE) { if (! get_bits(s, &zj, 1)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -1223,12 +1223,12 @@ int BZ2_decompress(DState *s)
} }
nblock++; nblock++;
if (get_mtf_val_init() == FALSE) { if (! get_mtf_val_init()) {
goto save_state_and_return; goto save_state_and_return;
} }
case BZ_X_MTF_5: case BZ_X_MTF_5:
s->state = BZ_X_MTF_5; s->state = BZ_X_MTF_5;
if (get_bits(s, &zvec, zn) == FALSE) { if (! get_bits(s, &zvec, zn)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -1244,7 +1244,7 @@ int BZ2_decompress(DState *s)
case BZ_X_MTF_6: case BZ_X_MTF_6:
s->state = BZ_X_MTF_6; s->state = BZ_X_MTF_6;
if (get_bits(s, &zj, 1) == FALSE) { if (! get_bits(s, &zj, 1)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -1366,7 +1366,7 @@ int BZ2_decompress(DState *s)
endhdr_2: endhdr_2:
case BZ_X_ENDHDR_2: case BZ_X_ENDHDR_2:
s->state = BZ_X_ENDHDR_2; s->state = BZ_X_ENDHDR_2;
if (get_bits(s, &uc, 8) == FALSE) { if (! get_bits(s, &uc, 8)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -1377,7 +1377,7 @@ endhdr_2:
case BZ_X_ENDHDR_3: case BZ_X_ENDHDR_3:
s->state = BZ_X_ENDHDR_3; s->state = BZ_X_ENDHDR_3;
if (get_bits(s, &uc, 8) == FALSE) { if (! get_bits(s, &uc, 8)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -1388,7 +1388,7 @@ endhdr_2:
case BZ_X_ENDHDR_4: case BZ_X_ENDHDR_4:
s->state = BZ_X_ENDHDR_4; s->state = BZ_X_ENDHDR_4;
if (get_bits(s, &uc, 8) == FALSE) { if (! get_bits(s, &uc, 8)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -1399,7 +1399,7 @@ endhdr_2:
case BZ_X_ENDHDR_5: case BZ_X_ENDHDR_5:
s->state = BZ_X_ENDHDR_5; s->state = BZ_X_ENDHDR_5;
if (get_bits(s, &uc, 8) == FALSE) { if (! get_bits(s, &uc, 8)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -1410,7 +1410,7 @@ endhdr_2:
case BZ_X_ENDHDR_6: case BZ_X_ENDHDR_6:
s->state = BZ_X_ENDHDR_6; s->state = BZ_X_ENDHDR_6;
if (get_bits(s, &uc, 8) == FALSE) { if (! get_bits(s, &uc, 8)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -1422,14 +1422,14 @@ endhdr_2:
case BZ_X_CCRC_1: case BZ_X_CCRC_1:
s->state = BZ_X_CCRC_1; s->state = BZ_X_CCRC_1;
if (get_bits(s, &uc, 8) == FALSE) { if (! get_bits(s, &uc, 8)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((unsigned int)uc); s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((unsigned int)uc);
case BZ_X_CCRC_2: case BZ_X_CCRC_2:
s->state = BZ_X_CCRC_2; s->state = BZ_X_CCRC_2;
if (get_bits(s, &uc, 8) == FALSE) { if (! get_bits(s, &uc, 8)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -1437,7 +1437,7 @@ endhdr_2:
case BZ_X_CCRC_3: case BZ_X_CCRC_3:
s->state = BZ_X_CCRC_3; s->state = BZ_X_CCRC_3;
if (get_bits(s, &uc, 8) == FALSE) { if (! get_bits(s, &uc, 8)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }
@ -1445,7 +1445,7 @@ endhdr_2:
case BZ_X_CCRC_4: case BZ_X_CCRC_4:
s->state = BZ_X_CCRC_4; s->state = BZ_X_CCRC_4;
if (get_bits(s, &uc, 8) == FALSE) { if (! get_bits(s, &uc, 8)) {
retVal = BZ_OK; retVal = BZ_OK;
goto save_state_and_return; goto save_state_and_return;
} }

View File

@ -858,7 +858,7 @@ void write_status_file(deb_file_t **deb_file)
} }
} }
/* If the package from the status file wasnt handle above, do it now*/ /* If the package from the status file wasnt handle above, do it now*/
if (write_flag == FALSE) { if (! write_flag) {
fprintf(new_status_file, "%s\n\n", control_buffer); fprintf(new_status_file, "%s\n\n", control_buffer);
} }
@ -1206,7 +1206,7 @@ void remove_package(const unsigned int package_num)
exclude_files = create_list(conffile_name); exclude_files = create_list(conffile_name);
/* Some directories cant be removed straight away, so do multiple passes */ /* Some directories cant be removed straight away, so do multiple passes */
while (remove_file_array(remove_files, exclude_files) == TRUE); while (remove_file_array(remove_files, exclude_files));
/* Create a list of all /var/lib/dpkg/info/<package> files */ /* Create a list of all /var/lib/dpkg/info/<package> files */
remove_files = xmalloc(sizeof(char *) * 11); remove_files = xmalloc(sizeof(char *) * 11);
@ -1250,7 +1250,7 @@ void purge_package(const unsigned int package_num)
exclude_files[0] = NULL; exclude_files[0] = NULL;
/* Some directories cant be removed straight away, so do multiple passes */ /* Some directories cant be removed straight away, so do multiple passes */
while (remove_file_array(remove_files, exclude_files) == TRUE); while (remove_file_array(remove_files, exclude_files));
/* Create a list of all /var/lib/dpkg/info/<package> files */ /* Create a list of all /var/lib/dpkg/info/<package> files */
remove_files = xmalloc(sizeof(char *) * 11); remove_files = xmalloc(sizeof(char *) * 11);

View File

@ -171,7 +171,7 @@ extern int gunzip_main(int argc, char **argv)
fclose(out_file); fclose(out_file);
fclose(in_file); fclose(in_file);
if (delete_old_file == TRUE) { if (delete_old_file) {
if (unlink(delete_file_name) < 0) { if (unlink(delete_file_name) < 0) {
error_msg_and_die("Couldnt remove %s", delete_file_name); error_msg_and_die("Couldnt remove %s", delete_file_name);
} }

View File

@ -227,7 +227,7 @@ char *unarchive(FILE *src_stream, FILE *out_stream, file_header_t *(*get_headers
} }
} }
if (extract_flag == TRUE) { if (extract_flag) {
buffer = extract_archive(src_stream, out_stream, file_entry, extract_function, prefix); buffer = extract_archive(src_stream, out_stream, file_entry, extract_function, prefix);
} else { } else {
/* seek past the data entry */ /* seek past the data entry */

View File

@ -476,9 +476,9 @@ static int writeTarFile(const char* tarName, int verboseFlag, char **argv,
/* Read the directory/files and iterate over them one at a time */ /* Read the directory/files and iterate over them one at a time */
while (*argv != NULL) { while (*argv != NULL) {
if (recursive_action(*argv++, TRUE, FALSE, FALSE, if (! recursive_action(*argv++, TRUE, FALSE, FALSE,
writeFileToTarball, writeFileToTarball, writeFileToTarball, writeFileToTarball,
(void*) &tbInfo) == FALSE) { (void*) &tbInfo)) {
errorFlag = TRUE; errorFlag = TRUE;
} }
} }
@ -494,7 +494,7 @@ static int writeTarFile(const char* tarName, int verboseFlag, char **argv,
/* Hang up the tools, close up shop, head home */ /* Hang up the tools, close up shop, head home */
close(tarFd); close(tarFd);
if (errorFlag == TRUE) { if (errorFlag) {
error_msg("Error exit delayed from previous errors"); error_msg("Error exit delayed from previous errors");
freeHardLinkInfo(&tbInfo.hlInfoHead); freeHardLinkInfo(&tbInfo.hlInfoHead);
return(FALSE); return(FALSE);
@ -556,7 +556,7 @@ char **list_and_not_list(char **include_list, char **exclude_list)
exclude_count++; exclude_count++;
} }
if (found == FALSE) { if (! found) {
new_include_list = realloc(new_include_list, sizeof(char *) * (include_count + 2)); new_include_list = realloc(new_include_list, sizeof(char *) * (include_count + 2));
new_include_list[new_include_count] = include_list[include_count]; new_include_list[new_include_count] = include_list[include_count];
new_include_count++; new_include_count++;

View File

@ -37,7 +37,7 @@ extern int cat_main(int argc, char **argv)
while (--argc > 0) { while (--argc > 0) {
if(!(strcmp(*++argv, "-"))) { if(!(strcmp(*++argv, "-"))) {
print_file(stdin); print_file(stdin);
} else if (print_file_by_name(*argv) == FALSE) { } else if (! print_file_by_name(*argv)) {
status = EXIT_FAILURE; status = EXIT_FAILURE;
} }
} }

View File

@ -72,8 +72,8 @@ int chgrp_main(int argc, char **argv)
/* Ok, ready to do the deed now */ /* Ok, ready to do the deed now */
while (++optind < argc) { while (++optind < argc) {
if (recursive_action (argv[optind], recursiveFlag, FALSE, FALSE, if (! recursive_action (argv[optind], recursiveFlag, FALSE, FALSE,
fileAction, fileAction, NULL) == FALSE) { fileAction, fileAction, NULL)) {
return EXIT_FAILURE; return EXIT_FAILURE;
} }
} }

View File

@ -58,7 +58,7 @@ int chmod_main(int argc, char **argv)
if (argc > optind && argc > 2 && argv[optind]) { if (argc > optind && argc > 2 && argv[optind]) {
/* Parse the specified mode */ /* Parse the specified mode */
mode_t mode; mode_t mode;
if (parse_mode(argv[optind], &mode) == FALSE) { if (! parse_mode(argv[optind], &mode)) {
error_msg_and_die( "unknown mode: %s", argv[optind]); error_msg_and_die( "unknown mode: %s", argv[optind]);
} }
} else { } else {
@ -67,8 +67,8 @@ int chmod_main(int argc, char **argv)
/* Ok, ready to do the deed now */ /* Ok, ready to do the deed now */
for (i = optind + 1; i < argc; i++) { for (i = optind + 1; i < argc; i++) {
if (recursive_action (argv[i], recursiveFlag, FALSE, FALSE, fileAction, if (! recursive_action (argv[i], recursiveFlag, FALSE, FALSE, fileAction,
fileAction, argv[optind]) == FALSE) { fileAction, argv[optind])) {
return EXIT_FAILURE; return EXIT_FAILURE;
} }
} }

View File

@ -94,8 +94,8 @@ int chown_main(int argc, char **argv)
/* Ok, ready to do the deed now */ /* Ok, ready to do the deed now */
while (++optind < argc) { while (++optind < argc) {
if (recursive_action (argv[optind], recursiveFlag, FALSE, FALSE, if (! recursive_action (argv[optind], recursiveFlag, FALSE, FALSE,
fileAction, fileAction, NULL) == FALSE) { fileAction, fileAction, NULL)) {
return EXIT_FAILURE; return EXIT_FAILURE;
} }
} }

View File

@ -193,7 +193,7 @@ static unsigned long ls_disp_hr = 0;
static int my_stat(struct dnode *cur) static int my_stat(struct dnode *cur)
{ {
#ifdef CONFIG_FEATURE_LS_FOLLOWLINKS #ifdef CONFIG_FEATURE_LS_FOLLOWLINKS
if (follow_links == TRUE) { if (follow_links) {
if (stat(cur->fullname, &cur->dstat)) { if (stat(cur->fullname, &cur->dstat)) {
perror_msg("%s", cur->fullname); perror_msg("%s", cur->fullname);
status = EXIT_FAILURE; status = EXIT_FAILURE;

View File

@ -53,10 +53,10 @@ extern int touch_main(int argc, char **argv)
} }
while (argc > 0) { while (argc > 0) {
fd = open(*argv, (create == FALSE) ? O_RDWR : O_RDWR | O_CREAT, fd = open(*argv, create ? O_RDWR | O_CREAT : O_RDWR,
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
if (fd < 0) { if (fd < 0) {
if (create == FALSE && errno == ENOENT) { if (! create && errno == ENOENT) {
argc--; argc--;
argv++; argv++;
continue; continue;

View File

@ -19,7 +19,7 @@
*/ */
static const char vi_Version[] = static const char vi_Version[] =
"$Id: vi.c,v 1.19 2001/11/17 07:14:06 andersen Exp $"; "$Id: vi.c,v 1.20 2001/12/20 23:12:47 kraai Exp $";
/* /*
* To compile for standalone use: * To compile for standalone use:
@ -1219,7 +1219,7 @@ key_cmd_mode:
break; break;
if (strncasecmp((char *) p, "quit", cnt) == 0 || if (strncasecmp((char *) p, "quit", cnt) == 0 ||
strncasecmp((char *) p, "q!", cnt) == 0) { // delete lines strncasecmp((char *) p, "q!", cnt) == 0) { // delete lines
if (file_modified == TRUE && p[1] != '!') { if (file_modified && p[1] != '!') {
psbs("No write since last change (:quit! overrides)"); psbs("No write since last change (:quit! overrides)");
} else { } else {
editing = 0; editing = 0;
@ -1410,10 +1410,10 @@ key_cmd_mode:
indicate_error(c); indicate_error(c);
break; break;
} }
if (file_modified == TRUE if (file_modified
#ifdef CONFIG_FEATURE_VI_READONLY #ifdef CONFIG_FEATURE_VI_READONLY
&& vi_readonly == FALSE && ! vi_readonly
&& readonly == FALSE && ! readonly
#endif /* CONFIG_FEATURE_VI_READONLY */ #endif /* CONFIG_FEATURE_VI_READONLY */
) { ) {
cnt = file_write(cfn, text, end - 1); cnt = file_write(cfn, text, end - 1);
@ -1829,7 +1829,7 @@ static void colon(Byte * buf)
int sr; int sr;
sr= 0; sr= 0;
// don't edit, if the current file has been modified // don't edit, if the current file has been modified
if (file_modified == TRUE && useforce != TRUE) { if (file_modified && ! useforce) {
psbs("No write since last change (:edit! overrides)"); psbs("No write since last change (:edit! overrides)");
goto vc1; goto vc1;
} }
@ -1908,7 +1908,7 @@ static void colon(Byte * buf)
" %dL, %dC", cfn, " %dL, %dC", cfn,
(sr < 0 ? " [New file]" : ""), (sr < 0 ? " [New file]" : ""),
#ifdef CONFIG_FEATURE_VI_READONLY #ifdef CONFIG_FEATURE_VI_READONLY
((vi_readonly == TRUE || readonly == TRUE) ? " [Read only]" : ""), ((vi_readonly || readonly) ? " [Read only]" : ""),
#endif /* CONFIG_FEATURE_VI_READONLY */ #endif /* CONFIG_FEATURE_VI_READONLY */
li, ch); li, ch);
} else if (strncasecmp((char *) cmd, "file", i) == 0) { // what File is this } else if (strncasecmp((char *) cmd, "file", i) == 0) { // what File is this
@ -1961,7 +1961,7 @@ static void colon(Byte * buf)
Hit_Return(); Hit_Return();
} else if ((strncasecmp((char *) cmd, "quit", i) == 0) || // Quit } else if ((strncasecmp((char *) cmd, "quit", i) == 0) || // Quit
(strncasecmp((char *) cmd, "next", i) == 0)) { // edit next file (strncasecmp((char *) cmd, "next", i) == 0)) { // edit next file
if (useforce == TRUE) { if (useforce) {
// force end of argv list // force end of argv list
if (*cmd == 'q') { if (*cmd == 'q') {
optind = save_argc; optind = save_argc;
@ -1970,7 +1970,7 @@ static void colon(Byte * buf)
goto vc1; goto vc1;
} }
// don't exit if the file been modified // don't exit if the file been modified
if (file_modified == TRUE) { if (file_modified) {
psbs("No write since last change (:%s! overrides)", psbs("No write since last change (:%s! overrides)",
(*cmd == 'q' ? "quit" : "next")); (*cmd == 'q' ? "quit" : "next"));
goto vc1; goto vc1;
@ -2014,7 +2014,7 @@ static void colon(Byte * buf)
#endif /* CONFIG_FEATURE_VI_READONLY */ #endif /* CONFIG_FEATURE_VI_READONLY */
" %dL, %dC", fn, " %dL, %dC", fn,
#ifdef CONFIG_FEATURE_VI_READONLY #ifdef CONFIG_FEATURE_VI_READONLY
((vi_readonly == TRUE || readonly == TRUE) ? " [Read only]" : ""), ((vi_readonly || readonly) ? " [Read only]" : ""),
#endif /* CONFIG_FEATURE_VI_READONLY */ #endif /* CONFIG_FEATURE_VI_READONLY */
li, ch); li, ch);
if (ch > 0) { if (ch > 0) {
@ -2024,7 +2024,7 @@ static void colon(Byte * buf)
file_modified = TRUE; file_modified = TRUE;
} }
} else if (strncasecmp((char *) cmd, "rewind", i) == 0) { // rewind cmd line args } else if (strncasecmp((char *) cmd, "rewind", i) == 0) { // rewind cmd line args
if (file_modified == TRUE && useforce != TRUE) { if (file_modified && ! useforce) {
psbs("No write since last change (:rewind! overrides)"); psbs("No write since last change (:rewind! overrides)");
} else { } else {
// reset the filenames to edit // reset the filenames to edit
@ -2140,7 +2140,7 @@ static void colon(Byte * buf)
fn = args; fn = args;
} }
#ifdef CONFIG_FEATURE_VI_READONLY #ifdef CONFIG_FEATURE_VI_READONLY
if ((vi_readonly == TRUE || readonly == TRUE) && useforce == FALSE) { if ((vi_readonly || readonly) && ! useforce) {
psbs("\"%s\" File is read only", fn); psbs("\"%s\" File is read only", fn);
goto vc3; goto vc3;
} }
@ -2149,14 +2149,14 @@ static void colon(Byte * buf)
li = count_lines(q, r); li = count_lines(q, r);
ch = r - q + 1; ch = r - q + 1;
// see if file exists- if not, its just a new file request // see if file exists- if not, its just a new file request
if (useforce == TRUE) { if (useforce) {
// if "fn" is not write-able, chmod u+w // if "fn" is not write-able, chmod u+w
// sprintf(syscmd, "chmod u+w %s", fn); // sprintf(syscmd, "chmod u+w %s", fn);
// system(syscmd); // system(syscmd);
forced = TRUE; forced = TRUE;
} }
l = file_write(fn, q, r); l = file_write(fn, q, r);
if (useforce == TRUE && forced == TRUE) { if (useforce && forced) {
// chmod u-w // chmod u-w
// sprintf(syscmd, "chmod u-w %s", fn); // sprintf(syscmd, "chmod u-w %s", fn);
// system(syscmd); // system(syscmd);
@ -3527,7 +3527,7 @@ static int file_insert(Byte * fn, Byte * p, int size)
// see if we can open the file // see if we can open the file
#ifdef CONFIG_FEATURE_VI_READONLY #ifdef CONFIG_FEATURE_VI_READONLY
if (vi_readonly == TRUE) goto fi1; // do not try write-mode if (vi_readonly) goto fi1; // do not try write-mode
#endif #endif
fd = open((char *) fn, O_RDWR); // assume read & write fd = open((char *) fn, O_RDWR); // assume read & write
if (fd < 0) { if (fd < 0) {
@ -3623,7 +3623,7 @@ static void place_cursor(int row, int col, int opti)
//----- 1. Try the standard terminal ESC sequence //----- 1. Try the standard terminal ESC sequence
sprintf((char *) cm1, CMrc, row + 1, col + 1); sprintf((char *) cm1, CMrc, row + 1, col + 1);
cm= cm1; cm= cm1;
if (opti == FALSE) goto pc0; if (! opti) goto pc0;
#ifdef CONFIG_FEATURE_VI_OPTIMIZE_CURSOR #ifdef CONFIG_FEATURE_VI_OPTIMIZE_CURSOR
//----- find the minimum # of chars to move cursor ------------- //----- find the minimum # of chars to move cursor -------------
@ -3798,9 +3798,9 @@ static void edit_status(void) // show file status on status line
"%s line %d of %d --%d%%--", "%s line %d of %d --%d%%--",
(cfn != 0 ? (char *) cfn : "No file"), (cfn != 0 ? (char *) cfn : "No file"),
#ifdef CONFIG_FEATURE_VI_READONLY #ifdef CONFIG_FEATURE_VI_READONLY
((vi_readonly == TRUE || readonly == TRUE) ? " [Read only]" : ""), ((vi_readonly || readonly) ? " [Read only]" : ""),
#endif /* CONFIG_FEATURE_VI_READONLY */ #endif /* CONFIG_FEATURE_VI_READONLY */
(file_modified == TRUE ? " [modified]" : ""), (file_modified ? " [modified]" : ""),
cur, tot, percent); cur, tot, percent);
} }
@ -3888,7 +3888,7 @@ static void refresh(int full_screen)
cs= 0; cs= 0;
ce= columns-1; ce= columns-1;
sp = &screen[li * columns]; // start of screen line sp = &screen[li * columns]; // start of screen line
if (full_screen == TRUE) { if (full_screen) {
// force re-draw of every single column from 0 - columns-1 // force re-draw of every single column from 0 - columns-1
goto re0; goto re0;
} }
@ -3921,7 +3921,7 @@ static void refresh(int full_screen)
if (ce > columns-1) ce= columns-1; if (ce > columns-1) ce= columns-1;
if (cs > ce) { cs= 0; ce= columns-1; } if (cs > ce) { cs= 0; ce= columns-1; }
// is there a change between vitual screen and buf // is there a change between vitual screen and buf
if (changed == TRUE) { if (changed) {
// copy changed part of buffer to virtual screen // copy changed part of buffer to virtual screen
memmove(sp+cs, buf+(cs+offset), ce-cs+1); memmove(sp+cs, buf+(cs+offset), ce-cs+1);

View File

@ -185,13 +185,13 @@ int find_main(int argc, char **argv)
} }
if (firstopt == 1) { if (firstopt == 1) {
if (recursive_action(".", TRUE, dereference, FALSE, fileAction, if (! recursive_action(".", TRUE, dereference, FALSE, fileAction,
fileAction, NULL) == FALSE) fileAction, NULL))
status = EXIT_FAILURE; status = EXIT_FAILURE;
} else { } else {
for (i = 1; i < firstopt; i++) { for (i = 1; i < firstopt; i++) {
if (recursive_action(argv[i], TRUE, dereference, FALSE, fileAction, if (! recursive_action(argv[i], TRUE, dereference, FALSE, fileAction,
fileAction, NULL) == FALSE) fileAction, NULL))
status = EXIT_FAILURE; status = EXIT_FAILURE;
} }
} }

View File

@ -547,7 +547,7 @@ static pid_t run(char *command, char *terminal, int get_enter)
} }
} }
if (get_enter == TRUE) { if (get_enter) {
/* /*
* Save memory by not exec-ing anything large (like a shell) * Save memory by not exec-ing anything large (like a shell)
* before the user wants it. This is critical if swap is not * before the user wants it. This is critical if swap is not
@ -942,7 +942,7 @@ static void parse_inittab(void)
} }
a++; a++;
} }
if (foundIt == TRUE) if (foundIt)
continue; continue;
else { else {
/* Choke on an unknown action */ /* Choke on an unknown action */

View File

@ -39,7 +39,7 @@ int is_directory(const char *fileName, const int followLinks, struct stat *statB
++didMalloc; ++didMalloc;
} }
if (followLinks == TRUE) if (followLinks)
status = stat(fileName, statBuf); status = stat(fileName, statBuf);
else else
status = lstat(fileName, statBuf); status = lstat(fileName, statBuf);

View File

@ -77,7 +77,7 @@ int read_package_field(const char *package_buffer, char **field_name, char **fie
} }
break; break;
} }
if (exit_flag == TRUE) { if (exit_flag) {
/* Check that the names are valid */ /* Check that the names are valid */
offset_value_end = offset; offset_value_end = offset;
name_length = offset_name_end - offset_name_start; name_length = offset_name_end - offset_name_start;

View File

@ -53,7 +53,7 @@ int recursive_action(const char *fileName,
struct stat statbuf; struct stat statbuf;
struct dirent *next; struct dirent *next;
if (followLinks == TRUE) if (followLinks)
status = stat(fileName, &statbuf); status = stat(fileName, &statbuf);
else else
status = lstat(fileName, &statbuf); status = lstat(fileName, &statbuf);
@ -68,14 +68,14 @@ int recursive_action(const char *fileName,
return FALSE; return FALSE;
} }
if ((followLinks == FALSE) && (S_ISLNK(statbuf.st_mode))) { if (! followLinks && (S_ISLNK(statbuf.st_mode))) {
if (fileAction == NULL) if (fileAction == NULL)
return TRUE; return TRUE;
else else
return fileAction(fileName, &statbuf, userData); return fileAction(fileName, &statbuf, userData);
} }
if (recurse == FALSE) { if (! recurse) {
if (S_ISDIR(statbuf.st_mode)) { if (S_ISDIR(statbuf.st_mode)) {
if (dirAction != NULL) if (dirAction != NULL)
return (dirAction(fileName, &statbuf, userData)); return (dirAction(fileName, &statbuf, userData));
@ -87,9 +87,9 @@ int recursive_action(const char *fileName,
if (S_ISDIR(statbuf.st_mode)) { if (S_ISDIR(statbuf.st_mode)) {
DIR *dir; DIR *dir;
if (dirAction != NULL && depthFirst == FALSE) { if (dirAction != NULL && ! depthFirst) {
status = dirAction(fileName, &statbuf, userData); status = dirAction(fileName, &statbuf, userData);
if (status == FALSE) { if (! status) {
perror_msg("%s", fileName); perror_msg("%s", fileName);
return FALSE; return FALSE;
} else if (status == SKIP) } else if (status == SKIP)
@ -109,20 +109,20 @@ int recursive_action(const char *fileName,
continue; continue;
} }
nextFile = concat_path_file(fileName, next->d_name); nextFile = concat_path_file(fileName, next->d_name);
if (recursive_action(nextFile, TRUE, followLinks, depthFirst, if (! recursive_action(nextFile, TRUE, followLinks, depthFirst,
fileAction, dirAction, userData) == FALSE) { fileAction, dirAction, userData)) {
status = FALSE; status = FALSE;
} }
free(nextFile); free(nextFile);
} }
closedir(dir); closedir(dir);
if (dirAction != NULL && depthFirst == TRUE) { if (dirAction != NULL && depthFirst) {
if (dirAction(fileName, &statbuf, userData) == FALSE) { if (! dirAction(fileName, &statbuf, userData)) {
perror_msg("%s", fileName); perror_msg("%s", fileName);
return FALSE; return FALSE;
} }
} }
if (status == FALSE) if (! status)
return FALSE; return FALSE;
} else { } else {
if (fileAction == NULL) if (fileAction == NULL)

View File

@ -133,7 +133,7 @@
#ifndef MODUTILS_MODULE_H #ifndef MODUTILS_MODULE_H
static const int MODUTILS_MODULE_H = 1; static const int MODUTILS_MODULE_H = 1;
#ident "$Id: insmod.c,v 1.76 2001/12/14 16:08:17 kraai Exp $" #ident "$Id: insmod.c,v 1.77 2001/12/20 23:13:08 kraai Exp $"
/* This file contains the structures used by the 2.0 and 2.1 kernels. /* This file contains the structures used by the 2.0 and 2.1 kernels.
We do not use the kernel headers directly because we do not wish We do not use the kernel headers directly because we do not wish
@ -350,7 +350,7 @@ int delete_module(const char *);
#ifndef MODUTILS_OBJ_H #ifndef MODUTILS_OBJ_H
static const int MODUTILS_OBJ_H = 1; static const int MODUTILS_OBJ_H = 1;
#ident "$Id: insmod.c,v 1.76 2001/12/14 16:08:17 kraai Exp $" #ident "$Id: insmod.c,v 1.77 2001/12/20 23:13:08 kraai Exp $"
/* The relocatable object is manipulated using elfin types. */ /* The relocatable object is manipulated using elfin types. */
@ -3314,8 +3314,8 @@ extern int insmod_main( int argc, char **argv)
strcpy(module_dir, _PATH_MODULES); strcpy(module_dir, _PATH_MODULES);
/* No module found under /lib/modules/`uname -r`, this /* No module found under /lib/modules/`uname -r`, this
* time cast the net a bit wider. Search /lib/modules/ */ * time cast the net a bit wider. Search /lib/modules/ */
if (recursive_action(module_dir, TRUE, FALSE, FALSE, if (! recursive_action(module_dir, TRUE, FALSE, FALSE,
check_module_name_match, 0, m_fullName) == FALSE) check_module_name_match, 0, m_fullName))
{ {
if (m_filename[0] == '\0' if (m_filename[0] == '\0'
|| ((fp = fopen(m_filename, "r")) == NULL)) || ((fp = fopen(m_filename, "r")) == NULL))

View File

@ -278,7 +278,7 @@ static void handlenetinput(int len)
break; break;
case TS_SUB1: /* Subnegotiation */ case TS_SUB1: /* Subnegotiation */
case TS_SUB2: /* Subnegotiation */ case TS_SUB2: /* Subnegotiation */
if (subneg(c) == TRUE) if (subneg(c))
G.telstate = TS_0; G.telstate = TS_0;
break; break;
} }

View File

@ -133,7 +133,7 @@ extern int kill_main(int argc, char **argv)
* upon exit, so we can save a byte or two */ * upon exit, so we can save a byte or two */
argv++; argv++;
} }
if (all_found == FALSE) if (! all_found)
return EXIT_FAILURE; return EXIT_FAILURE;
} }
#endif #endif

View File

@ -8172,7 +8172,7 @@ umaskcmd(int argc, char **argv)
umask(mask); umask(mask);
} else { } else {
mask = ~mask & 0777; mask = ~mask & 0777;
if (parse_mode(ap, &mask) == FALSE) { if (! parse_mode(ap, &mask)) {
error("Illegal mode: %s", ap); error("Illegal mode: %s", ap);
} }
umask(~mask & 0777); umask(~mask & 0777);
@ -12481,7 +12481,7 @@ findvar(struct var **vpp, const char *name)
/* /*
* Copyright (c) 1999 Herbert Xu <herbert@debian.org> * Copyright (c) 1999 Herbert Xu <herbert@debian.org>
* This file contains code for the times builtin. * This file contains code for the times builtin.
* $Id: ash.c,v 1.37 2001/12/06 03:37:38 aaronl Exp $ * $Id: ash.c,v 1.38 2001/12/20 23:13:19 kraai Exp $
*/ */
static int timescmd (int argc, char **argv) static int timescmd (int argc, char **argv)
{ {

View File

@ -769,7 +769,7 @@ static char **exe_n_cwd_tab_completion(char *command, int *num_matches,
goto cont; goto cont;
str_found = add_quote_for_spec_chars(found); str_found = add_quote_for_spec_chars(found);
if (type == FIND_FILE_ONLY || if (type == FIND_FILE_ONLY ||
(type == FIND_EXE_ONLY && is_execute(&st) == TRUE)) (type == FIND_EXE_ONLY && is_execute(&st)))
strcat(str_found, " "); strcat(str_found, " ");
} }
/* Add it to the list */ /* Add it to the list */
@ -980,7 +980,7 @@ static void input_tab(int *lastWasTab)
} }
return; return;
} }
if (*lastWasTab == FALSE) { if (! *lastWasTab) {
char *tmp; char *tmp;
int len_found; int len_found;

View File

@ -1437,7 +1437,7 @@ static int busy_loop(FILE * input)
next_command = command; next_command = command;
} }
if (expand_arguments(next_command) == FALSE) { if (! expand_arguments(next_command)) {
free(command); free(command);
command = (char *) xcalloc(BUFSIZ, sizeof(char)); command = (char *) xcalloc(BUFSIZ, sizeof(char));
next_command = NULL; next_command = NULL;

View File

@ -135,7 +135,7 @@ extern int klogd_main(int argc, char **argv)
} }
} }
if (doFork == TRUE) { if (doFork) {
#if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__) #if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__)
if (daemon(0, 1) < 0) if (daemon(0, 1) < 0)
perror_msg_and_die("daemon"); perror_msg_and_die("daemon");

View File

@ -276,7 +276,7 @@ static void message (char *fmt, ...)
fl.l_len = 1; fl.l_len = 1;
#ifdef CONFIG_FEATURE_IPC_SYSLOG #ifdef CONFIG_FEATURE_IPC_SYSLOG
if ((circular_logging == TRUE) && (buf != NULL)){ if ((circular_logging) && (buf != NULL)){
char b[1024]; char b[1024];
va_start (arguments, fmt); va_start (arguments, fmt);
vsprintf (b, fmt, arguments); vsprintf (b, fmt, arguments);
@ -366,7 +366,7 @@ static const int IOV_COUNT = 2;
"%s:%d",RemoteHost,RemotePort); "%s:%d",RemoteHost,RemotePort);
} }
} }
if (local_logging == TRUE) if (local_logging)
#endif #endif
/* now spew out the message to wherever it is supposed to go */ /* now spew out the message to wherever it is supposed to go */
message("%s %s %s %s\n", timestamp, LocalHostName, res, msg); message("%s %s %s %s\n", timestamp, LocalHostName, res, msg);
@ -519,13 +519,13 @@ static void doSyslogd (void)
FD_SET (sock_fd, &fds); FD_SET (sock_fd, &fds);
#ifdef CONFIG_FEATURE_IPC_SYSLOG #ifdef CONFIG_FEATURE_IPC_SYSLOG
if (circular_logging == TRUE ){ if (circular_logging ){
ipcsyslog_init(); ipcsyslog_init();
} }
#endif #endif
#ifdef CONFIG_FEATURE_REMOTE_LOG #ifdef CONFIG_FEATURE_REMOTE_LOG
if (doRemoteLog == TRUE){ if (doRemoteLog){
init_RemoteLog(); init_RemoteLog();
} }
#endif #endif
@ -616,7 +616,7 @@ extern int syslogd_main(int argc, char **argv)
#ifdef CONFIG_FEATURE_REMOTE_LOG #ifdef CONFIG_FEATURE_REMOTE_LOG
/* If they have not specified remote logging, then log locally */ /* If they have not specified remote logging, then log locally */
if (doRemoteLog == FALSE) if (! doRemoteLog)
local_logging = TRUE; local_logging = TRUE;
#endif #endif
@ -629,7 +629,7 @@ extern int syslogd_main(int argc, char **argv)
umask(0); umask(0);
if (doFork == TRUE) { if (doFork) {
#if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__) #if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__)
if (daemon(0, 1) < 0) if (daemon(0, 1) < 0)
perror_msg_and_die("daemon"); perror_msg_and_die("daemon");

View File

@ -127,7 +127,7 @@ do_mount(char *specialfile, char *dir, char *filesystemtype,
char *lofile = NULL; char *lofile = NULL;
#endif #endif
if (fakeIt == FALSE) if (! fakeIt)
{ {
#if defined CONFIG_FEATURE_MOUNT_LOOP #if defined CONFIG_FEATURE_MOUNT_LOOP
if (use_loop==TRUE) { if (use_loop==TRUE) {
@ -163,7 +163,7 @@ do_mount(char *specialfile, char *dir, char *filesystemtype,
if (status == 0 || fakeIt==TRUE) { if (status == 0 || fakeIt==TRUE) {
#if defined CONFIG_FEATURE_MTAB_SUPPORT #if defined CONFIG_FEATURE_MTAB_SUPPORT
if (useMtab == TRUE) { if (useMtab) {
erase_mtab(specialfile); // Clean any stale entries erase_mtab(specialfile); // Clean any stale entries
write_mtab(specialfile, dir, filesystemtype, flags, mtab_opts); write_mtab(specialfile, dir, filesystemtype, flags, mtab_opts);
} }
@ -210,19 +210,19 @@ parse_mount_options(char *options, int *flags, char *strflags)
f++; f++;
} }
#if defined CONFIG_FEATURE_MOUNT_LOOP #if defined CONFIG_FEATURE_MOUNT_LOOP
if (gotone == FALSE && !strcasecmp("loop", options)) { /* loop device support */ if (! gotone && !strcasecmp("loop", options)) { /* loop device support */
use_loop = TRUE; use_loop = TRUE;
gotone = TRUE; gotone = TRUE;
} }
#endif #endif
if (*strflags && strflags != '\0' && gotone == FALSE) { if (*strflags && strflags != '\0' && ! gotone) {
char *temp = strflags; char *temp = strflags;
temp += strlen(strflags); temp += strlen(strflags);
*temp++ = ','; *temp++ = ',';
*temp++ = '\0'; *temp++ = '\0';
} }
if (gotone == FALSE) if (! gotone)
strcat(strflags, options); strcat(strflags, options);
if (comma) { if (comma) {
*comma = ','; *comma = ',';
@ -261,7 +261,7 @@ mount_one(char *blockDevice, char *directory, char *filesystemType,
status = do_mount(blockDevice, directory, filesystemType, status = do_mount(blockDevice, directory, filesystemType,
flags | MS_MGC_VAL, string_flags, flags | MS_MGC_VAL, string_flags,
useMtab, fakeIt, mtab_opts, mount_all); useMtab, fakeIt, mtab_opts, mount_all);
if (status == TRUE) if (status)
break; break;
} }
} }
@ -286,7 +286,7 @@ mount_one(char *blockDevice, char *directory, char *filesystemType,
status = do_mount(blockDevice, directory, filesystemType, status = do_mount(blockDevice, directory, filesystemType,
flags | MS_MGC_VAL, string_flags, flags | MS_MGC_VAL, string_flags,
useMtab, fakeIt, mtab_opts, mount_all); useMtab, fakeIt, mtab_opts, mount_all);
if (status == TRUE) if (status)
break; break;
} }
} }
@ -299,8 +299,8 @@ mount_one(char *blockDevice, char *directory, char *filesystemType,
fakeIt, mtab_opts, mount_all); fakeIt, mtab_opts, mount_all);
} }
if (status == FALSE) { if (! status) {
if (whineOnErrors == TRUE) { if (whineOnErrors) {
perror_msg("Mounting %s on %s failed", blockDevice, directory); perror_msg("Mounting %s on %s failed", blockDevice, directory);
} }
return (FALSE); return (FALSE);
@ -433,7 +433,7 @@ extern int mount_main(int argc, char **argv)
if (optind + 1 < argc) if (optind + 1 < argc)
directory = simplify_path(argv[optind + 1]); directory = simplify_path(argv[optind + 1]);
if (all == TRUE || optind + 1 == argc) { if (all || optind + 1 == argc) {
struct mntent *m = NULL; struct mntent *m = NULL;
FILE *f = setmntent("/etc/fstab", "r"); FILE *f = setmntent("/etc/fstab", "r");
fstabmount = TRUE; fstabmount = TRUE;
@ -442,20 +442,20 @@ extern int mount_main(int argc, char **argv)
perror_msg_and_die( "\nCannot read /etc/fstab"); perror_msg_and_die( "\nCannot read /etc/fstab");
while ((m = getmntent(f)) != NULL) { while ((m = getmntent(f)) != NULL) {
if (all == FALSE && optind + 1 == argc && ( if (! all && optind + 1 == argc && (
(strcmp(device, m->mnt_fsname) != 0) && (strcmp(device, m->mnt_fsname) != 0) &&
(strcmp(device, m->mnt_dir) != 0) ) ) { (strcmp(device, m->mnt_dir) != 0) ) ) {
continue; continue;
} }
if (all == TRUE && ( // If we're mounting 'all' if (all && ( // If we're mounting 'all'
(strstr(m->mnt_opts, "noauto")) || // and the file system isn't noauto, (strstr(m->mnt_opts, "noauto")) || // and the file system isn't noauto,
(strstr(m->mnt_type, "swap")) || // and isn't swap or nfs, then mount it (strstr(m->mnt_type, "swap")) || // and isn't swap or nfs, then mount it
(strstr(m->mnt_type, "nfs")) ) ) { (strstr(m->mnt_type, "nfs")) ) ) {
continue; continue;
} }
if (all == TRUE || flags == 0) { // Allow single mount to override fstab flags if (all || flags == 0) { // Allow single mount to override fstab flags
flags = 0; flags = 0;
string_flags = string_flags_buf; string_flags = string_flags_buf;
*string_flags = '\0'; *string_flags = '\0';
@ -483,13 +483,13 @@ singlemount:
string_flags, useMtab, fakeIt, extra_opts, TRUE, all)) string_flags, useMtab, fakeIt, extra_opts, TRUE, all))
rc = EXIT_FAILURE; rc = EXIT_FAILURE;
if (all == FALSE) if (! all)
break; break;
} }
if (fstabmount == TRUE) if (fstabmount)
endmntent(f); endmntent(f);
if (all == FALSE && fstabmount == TRUE && m == NULL) if (! all && fstabmount && m == NULL)
fprintf(stderr, "Can't find %s in /etc/fstab\n", device); fprintf(stderr, "Can't find %s in /etc/fstab\n", device);
return rc; return rc;

View File

@ -179,19 +179,19 @@ static int do_umount(const char *name)
status = umount(name); status = umount(name);
#if defined CONFIG_FEATURE_MOUNT_LOOP #if defined CONFIG_FEATURE_MOUNT_LOOP
if (freeLoop == TRUE && blockDevice != NULL && !strncmp("/dev/loop", blockDevice, 9)) if (freeLoop && blockDevice != NULL && !strncmp("/dev/loop", blockDevice, 9))
/* this was a loop device, delete it */ /* this was a loop device, delete it */
del_loop(blockDevice); del_loop(blockDevice);
#endif #endif
#if defined CONFIG_FEATURE_MOUNT_FORCE #if defined CONFIG_FEATURE_MOUNT_FORCE
if (status != 0 && doForce == TRUE) { if (status != 0 && doForce) {
status = umount2(blockDevice, MNT_FORCE); status = umount2(blockDevice, MNT_FORCE);
if (status != 0) { if (status != 0) {
error_msg_and_die("forced umount of %s failed!", blockDevice); error_msg_and_die("forced umount of %s failed!", blockDevice);
} }
} }
#endif #endif
if (status != 0 && doRemount == TRUE && errno == EBUSY) { if (status != 0 && doRemount && errno == EBUSY) {
status = mount(blockDevice, name, NULL, status = mount(blockDevice, name, NULL,
MS_MGC_VAL | MS_REMOUNT | MS_RDONLY, NULL); MS_MGC_VAL | MS_REMOUNT | MS_RDONLY, NULL);
if (status == 0) { if (status == 0) {
@ -202,7 +202,7 @@ static int do_umount(const char *name)
} }
if (status == 0) { if (status == 0) {
#if defined CONFIG_FEATURE_MTAB_SUPPORT #if defined CONFIG_FEATURE_MTAB_SUPPORT
if (useMtab == TRUE) if (useMtab)
erase_mtab(name); erase_mtab(name);
#endif #endif
return (TRUE); return (TRUE);
@ -282,15 +282,15 @@ extern int umount_main(int argc, char **argv)
} }
mtab_read(); mtab_read();
if (umountAll == TRUE) { if (umountAll) {
if (umount_all() == TRUE) if (umount_all())
return EXIT_SUCCESS; return EXIT_SUCCESS;
else else
return EXIT_FAILURE; return EXIT_FAILURE;
} }
if (realpath(*argv, path) == NULL) if (realpath(*argv, path) == NULL)
perror_msg_and_die("%s", path); perror_msg_and_die("%s", path);
if (do_umount(path) == TRUE) if (do_umount(path))
return EXIT_SUCCESS; return EXIT_SUCCESS;
perror_msg_and_die("%s", *argv); perror_msg_and_die("%s", *argv);
} }