Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 61948 Build 58832: arc lint + arc unit
Event Timeline
usr.sbin/ctld/kernel.c | ||
---|---|---|
643 | Since you aren't using the type, anyway. |
usr.sbin/ctld/kernel.c | ||
---|---|---|
643 | Ah, ok. I thought it was mandatory for some reason. I think I need to fix this in a couple of places. |
usr.sbin/ctld/ctld.c | ||
---|---|---|
1565 | Another place that doesn't need type |
I don't remember nvlists much, but shouldn't errors be checked via nvlist_error() sometimes?
usr.sbin/ctld/ctld.c | ||
---|---|---|
1566 | The number of arguments seems to not match here. There should be prefix passed first. Considering the #if 0 I wonder if it was even build-tested. |
I'm not quite sure where to put the nvlist_error calls TBH.
usr.sbin/ctld/ctld.c | ||
---|---|---|
1566 | Oops, no, I was just trying to update the existing #if 0 code, but I haven't tried to make use of it. |
Kind of everywhere where errors are possible, I think. On a quick look it seems nvlist functions just stop working after some first error has happened. So I guess it may produce weird results if errors are not checked the caller. But In particular I've noticed that you removed ability to return errors from few places in parse.y.
So nvlist_pack() will fail and an error will ultimately get reported that way. I will re-add the duplicate option handling that was previously done in option_new (probably bringing back option_new as a wrapper).
In general the only way nvlist will fail is if malloc() fails, and if that happens the program is likely to crash anyway. I know ctld is one of the few programs we have that tries to check the results of calloc() and malloc(), but if that has failed you are almost better off crashing than running in a crippled state where you can't do anything (and outputting errors is probably going to try to call malloc() somewhere and blow up anyway).