Changeset View
Changeset View
Standalone View
Standalone View
lib/libsysdecode/flags.c
Show First 20 Lines • Show All 651 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
return (print_mask_int(fp, mlockallflags, flags, rem)); | return (print_mask_int(fp, mlockallflags, flags, rem)); | ||||
} | } | ||||
bool | bool | ||||
sysdecode_mmap_prot(FILE *fp, int prot, int *rem) | sysdecode_mmap_prot(FILE *fp, int prot, int *rem) | ||||
{ | { | ||||
int protm; | |||||
bool printed; | |||||
return (print_mask_int(fp, mmapprot, prot, rem)); | printed = false; | ||||
protm = PROT_MAX_EXTRACT(prot); | |||||
if (protm != 0) { | |||||
fputs("PROT_MAX(", fp); | |||||
printed = print_mask_int(fp, mmapprot, protm, rem); | |||||
fputs(")|", fp); | |||||
kib: Why don't you print non-max protection bits ? | |||||
prot = protm; | |||||
Done Inline ActionsMaybe I should strip the whole early return as both truss and dump ignore the return value anyway? kaktus: Maybe I should strip the whole early return as both truss and dump ignore the return value… | |||||
Not Done Inline ActionsI do not think that you should return early at all if first print_mask_int() returned false. Instead the final return value should be false, thats all. No, I do not think that changing the signature of the public function in libsysdecode is good idea. Because you would need to bump the lib version number due to the ABI changes, which seems to be more noise that to just satisfy the interface. kib: I do not think that you should return early at all if first print_mask_int() returned false. | |||||
} | |||||
return (print_mask_int(fp, mmapprot, prot, rem) || printed); | |||||
} | } | ||||
bool | bool | ||||
sysdecode_fileflags(FILE *fp, fflags_t flags, fflags_t *rem) | sysdecode_fileflags(FILE *fp, fflags_t flags, fflags_t *rem) | ||||
{ | { | ||||
return (print_mask_0(fp, fileflags, flags, rem)); | return (print_mask_0(fp, fileflags, flags, rem)); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 600 Lines • Show Last 20 Lines |
Why don't you print non-max protection bits ?