chiark / gitweb /
Prep v231.2: Remove modes and states assertion in do_sleep()
authorSven Eden <yamakuzure@gmx.net>
Wed, 21 Jun 2017 06:49:50 +0000 (08:49 +0200)
committerSven Eden <yamakuzure@gmx.net>
Wed, 21 Jun 2017 06:49:50 +0000 (08:49 +0200)
It is perfectly valid to have NULL modes. The default configuration
for suspend to ram is such a case.
Having NULL states doesn't make any sense other than no suspension is
possible any more. But a user might have set any *State value to an
empty string, so better assume (and assert) nothing here.

src/sleep/sleep.c

index a2e8e603501a42f2da161537de3eb09fe336a91e..dc1d55d8b08c1b131c8f406c25f439ca8f9c3943 100644 (file)
@@ -220,9 +220,6 @@ finish:
 #else
 int do_sleep(const char *verb, char **modes, char **states) {
         assert(verb);
-        assert(modes);
-        assert(states);
-
         arg_verb = (char*)verb;
         return execute(modes, states);
 }