Page MenuHomeFreeBSD

syslogd: Replace int with bool, where applicable
ClosedPublic

Authored by jfree on Aug 8 2023, 3:02 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, May 3, 8:15 AM
Unknown Object (File)
Fri, May 3, 8:15 AM
Unknown Object (File)
Sun, Apr 28, 12:03 PM
Unknown Object (File)
Sat, Apr 27, 9:45 PM
Unknown Object (File)
Sat, Apr 27, 9:44 PM
Unknown Object (File)
Sat, Apr 27, 9:33 PM
Unknown Object (File)
Sat, Apr 27, 9:33 PM
Unknown Object (File)
Sat, Apr 27, 8:59 PM
Subscribers

Details

Summary
Many of syslogd's global configuration options are declared as integers
but are treated as booleans. Declare those options as booleans instead.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

In future when uploading patches via the web interface please generate them with -U99999 so that Phabricator can show full context (see https://wiki.freebsd.org/Phabricator for details)

Debug might make sense as an int again in the future if we want to support different debug levels, but bool makes sense right now.

This revision is now accepted and ready to land.Aug 8 2023, 3:13 PM

The needdofsync global variable was initialized as true, when it should be false. Fix this.

This revision now requires review to proceed.Aug 8 2023, 3:15 PM

In future when uploading patches via the web interface please generate them with -U99999 so that Phabricator can show full context (see https://wiki.freebsd.org/Phabricator for details)

Oops! Thought I did. Just regenerated the patches. Will upload with more context from here on.

The needdofsync global variable was initialized as true, when it should be false. Fix this.

We may want to just leave the 0/false globals without explicit initialization.

The needdofsync global variable was initialized as true, when it should be false. Fix this.

We may want to just leave the 0/false globals without explicit initialization.

I just carried over syslogd's code, translating 0 to false and 1 to true.

I believe I address your suggestion in a later patch.

I just carried over syslogd's code, translating 0 to false and 1 to true.

Yeah, certainly if we're going to remove the 0/false initialization it would be done in a prior or subsequent commit

This revision is now accepted and ready to land.Aug 9 2023, 7:01 PM
This revision now requires review to proceed.Aug 10 2023, 11:00 PM
This revision is now accepted and ready to land.Aug 11 2023, 2:32 PM
usr.sbin/syslogd/syslogd.c
390

this one remains int but uses true?

Do not assign boolean value to integer mask_C1

This revision now requires review to proceed.Aug 14 2023, 5:48 PM
This revision is now accepted and ready to land.Aug 14 2023, 6:25 PM
This revision was automatically updated to reflect the committed changes.