lsof icon indicating copy to clipboard operation
lsof copied to clipboard

use INODESPEC and INODETYPE in test cases in tests dir

Open masatake opened this issue 5 years ago • 0 comments

Item 1 and item 2 must be considered.

Thanks for the pointers I wasn't really familiar with the codebase but now I see the real issue was the test not using INODEPSPEC and INODETYPE (instead it used an unsigned int and %u). 

Going forward I think the fix is to replace
1. PRIu64 (used to be just _%u_ before my commit) --> INODEPSPEC "u" 
2. uint64_t (used to be just _unsigned int_ before my commit) --> INODETYPE
3. unsigned long long (for INODETYPE) --> uint64_t (**optional** based on your reply)
4. 'll' (for INODEPSPEC) --> PRIu64 (**optional** based on your reply)
    * For this reason I don't think we should change the optional bit since PRIu64 includes the "u" character and INODESPEC does not. If we changed it here we would need to change the other defs for it as well as main.c. IMO just the first 2 changes are good enough to fix the bug and keep the code consistent. 

Does this generally sound reasonable? Are you okay with me leaving the optional bit out for now?

Originally posted by @hvpeteet in https://github.com/lsof-org/lsof/pull/99#issuecomment-644260699

masatake avatar Oct 03 '20 19:10 masatake