8329 ldapcachemgr: misleading-indentation

Review Request #565 — Created June 4, 2017 and submitted

tsoome
illumos-gate
8329, 8364
2ce484a...
general
cachemgr.c: In function 'main':
cachemgr.c:471:3: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
   if (strlen(current_admin.logfile) == 0)
   ^~
cachemgr.c:473:4: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
    (void) cachemgr_set_lf(&current_admin,
    ^
cc1: all warnings being treated as errors


  • 0
  • 0
  • 0
  • 1
  • 1
Description From Last Updated
jbk
  1. Ship It!
  2. 
      
rm
  1. 
      
  2. usr/src/cmd/ldapcachemgr/cachemgr.c (Diff revision 1)
     
     
    How'd you figure out that this was the right replacement? Could you add some analysis? I think this makes sense, but I'm not 100% sure.
    1. The current_admin is global structure with logfile defined as fixed length string, so the current admin is initially zeroed out; this else block is setting the log file and just before calling the cachemgr_set_lf() to set log file, the code is making sure the current_admin.logfile has the actual file name. The /dev/null is set for log file only in case the ldapcachemgr was not started with -l, meaning the else block was meant to set log file, either to one specified with -l or /dev/null.

  3. 
      
tsoome
yuripv
  1. Ship It!
  2. 
      
jbk
  1. Ship It!
  2. 
      
tsoome
rm
  1. Ship It!
  2. 
      
tsoome
Review request changed

Status: Closed (submitted)

Loading...