6699 be_get_boot_args interface implementation in libbe (loader project)

Review Request #159 — Created March 1, 2016 and submitted

tsoome
illumos-gate
6699
general

6699 be_get_boot_args interface implementation in libbe (loader project)



  • 0
  • 0
  • 11
  • 0
  • 11
Description From Last Updated
tsoome
yuripv
  1. 
      
  2. usr/src/lib/libbe/common/be_utils.c (Diff revision 2)
     
     

    Why not simply MAXNAMELEN * 2? MAX_INPUT looks like something totally unrelated.

  3. usr/src/lib/libbe/common/be_utils.c (Diff revision 2)
     
     

    MAX_INPUT -> sizeof(buf)

  4. usr/src/lib/libbe/common/be_utils.c (Diff revision 2)
     
     

    MAX_INPUT -> sizeof(buf)

  5. usr/src/lib/libbe/common/be_utils.c (Diff revision 2)
     
     

    here and below - these error messages are really unhelpful

    1. added error code. Those messages are not visible without black magic (BE_PRINT_ERR=true env or libbe internal mechanism).

  6. usr/src/lib/libbe/common/be_utils.c (Diff revision 2)
     
     

    MAX_INPUT -> sizeof(buf)

  7. usr/src/lib/libbe/common/be_utils.c (Diff revision 2)
     
     

    MAX_INPUT -> sizeof(buf)

  8. usr/src/lib/libbe/common/be_utils.c (Diff revision 2)
     
     

    rpool -> root pool ?

  9. usr/src/lib/libbe/common/be_utils.c (Diff revision 2)
     
     

    MAX_INPUT -> sizeof(buf)

  10. usr/src/lib/libbe/common/be_utils.c (Diff revision 2)
     
     
    Could use buf = strsep(&buf, " "); here instead, I think.
    1. yes, thats true. Thanks to C99, fixed size array and char * are pain to manage:D

  11. usr/src/lib/libbe/common/be_utils.c (Diff revision 2)
     
     

    == '\0'

  12. 
      
tsoome
yuripv
  1. Ship It!
  2. 
      
tsoome
richlowe
  1. 
      
  2. usr/src/lib/libbe/common/be_utils.c (Diff revision 4)
     
     

    I would add a comment saying this is done intentionally, add an explicit return; to make that even more clear, and change the name to something that makes clear it does nothing as well (so people who see the use with bf_init know what's happening)

    1. fixed, except can not have empty function with return, pbchk:
      C style:
      usr/src/lib/libbe/common/be_utils.c: 96: unneeded return at end of function

  3. usr/src/lib/libbe/common/be_utils.c (Diff revision 4)
     
     

    cstyle says these all need to be explict != NULL checks

    1. actually, we don't need if statements there as free() is dealing with NULL pointers.

  4. 
      
tsoome
trisk
  1. Ship It!
  2. 
      
tsoome
Review request changed

Status: Closed (submitted)

Loading...