Skip to content

nofatal does not work (as advertised) #11

Description

@systemdlete

The "nofatal" option to openlog() does not work as suggested in the man page for this module. Calling program always exits out.

I was able to "fix" this by correcting what I think is an error in the code: $err_sub is supposed to be a coderef, if the comments in the code are to be believed. What I did is:

my $err_sub = sub { $options{nofatal} ? &warnings::warnif : &croak; };

I'm not sure why there are two places where this "coderef" is set, since the reference assignment in openlog should be sufficient given the man page says that openlog should always be called first. I also don't understand why the reference assignment in openlog insists on using "delete," but perhaps there is good reason to do this.

With my changes, the module seems to work with the nofatal option set, and it does not cause the calling program to crash or exit. The only problem is some annoying warnings about use of uninitialized value $current_proto in string eq.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions