user/5388: sasyncd(8) ignores -d, -v

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

user/5388: sasyncd(8) ignores -d, -v

sthen
>Number:         5388
>Category:       user
>Synopsis:       sasyncd(8) ignores -d, -v
>Confidential:   yes
>Severity:       non-critical
>Priority:       low
>Responsible:    bugs
>State:          open
>Quarter:        
>Keywords:      
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 22 13:00:01 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     sthen
>Release:        -current
>Organization:
net
>Environment:
       
        System      : OpenBSD 4.1
        Architecture: OpenBSD.i386
        Machine     : i386
>Description:
        sasyncd zeroes cfgstate after it has parsed the command line
        so the increased cfgstate.debug or cfgstate.verboselevel are lost.
>How-To-Repeat:
        # sasyncd -dv

        this should run in foreground with verbose output, but instead
        it daemonizes.
>Fix:
       

Index: sasyncd.c
===================================================================
RCS file: /cvs/src/usr.sbin/sasyncd/sasyncd.c,v
retrieving revision 1.16
diff -u -p -r1.16 sasyncd.c
--- sasyncd.c 26 Dec 2006 00:58:11 -0000 1.16
+++ sasyncd.c 22 Feb 2007 12:53:00 -0000
@@ -153,6 +153,8 @@ main(int argc, char **argv)
  return 1;
  }
 
+ memset(&cfgstate, 0, sizeof cfgstate);
+
  while ((ch = getopt(argc, argv, "c:dv")) != -1) {
  switch (ch) {
  case 'c':
@@ -179,7 +181,6 @@ main(int argc, char **argv)
  log_init(__progname);
  timer_init();
 
- memset(&cfgstate, 0, sizeof cfgstate);
  cfgstate.runstate = INIT;
  LIST_INIT(&cfgstate.peerlist);
 

>Release-Note:
>Audit-Trail:
>Unformatted: