Re: apmd/apm: propagate failure to apm, make apm report failure

2021-04-07 Thread Klemens Nanni
On Wed, Apr 07, 2021 at 12:35:12AM +0200, Jeremie Courreges-Anglas wrote: > And those functions could return zero/errno, this saves a few more > lines. ok? Even better, OK kn

Re: apmd/apm: propagate failure to apm, make apm report failure

2021-04-06 Thread Jeremie Courreges-Anglas
On Wed, Apr 07 2021, Klemens Nanni wrote: > On Tue, Apr 06, 2021 at 11:35:44PM +0200, Jeremie Courreges-Anglas wrote: [...] >> > @@ -321,40 +328,49 @@ handle_client(int sock_fd, int ctl_fd) >> >return reply.newstate; >> > } >> > >> > -void >> > +int >> > suspend(int ctl_fd) >> > { >> >

Re: apmd/apm: propagate failure to apm, make apm report failure

2021-04-06 Thread Klemens Nanni
On Tue, Apr 06, 2021 at 11:35:44PM +0200, Jeremie Courreges-Anglas wrote: > On Fri, Apr 02 2021, Klemens Nanni wrote: > > @@ -64,6 +64,7 @@ struct apm_reply { > > enum apm_perfmode perfmode; > > int cpuspeed; > > struct apm_power_info batterystate; > > + int error; > > }; > > >

Re: apmd/apm: propagate failure to apm, make apm report failure

2021-04-06 Thread Jeremie Courreges-Anglas
On Fri, Apr 02 2021, Klemens Nanni wrote: > On Fri, Mar 26, 2021 at 10:49:53PM +0100, Klemens Nanni wrote: >> On Fri, Mar 26, 2021 at 10:38:30PM +0100, Klemens Nanni wrote: >> > apm(8) never knows gets the result of the requested power action carried >> > out by apmd(8), so platforms without

Re: apmd/apm: propagate failure to apm, make apm report failure

2021-04-06 Thread Klemens Nanni
On Tue, Apr 06, 2021 at 01:44:38PM -0400, Dave Voutila wrote: > Working on my amd64 system. Sadly I don't have other archs (yet) to > test this on. But I don't see any reason it should impact any other > architectures. > > >> Feedback? OK? > > OK dv@, I do have some feedback/observations below

Re: apmd/apm: propagate failure to apm, make apm report failure

2021-04-06 Thread Dave Voutila
Klemens Nanni writes: > On Fri, Mar 26, 2021 at 10:38:30PM +0100, Klemens Nanni wrote: >> apm(8) never knows gets the result of the requested power action carried >> out by apmd(8), so platforms without suspend/resume support behave like >> this: >> >> $ zzz; echo $? >> Suspending

Re: apmd/apm: propagate failure to apm, make apm report failure

2021-04-02 Thread Klemens Nanni
On Fri, Mar 26, 2021 at 10:49:53PM +0100, Klemens Nanni wrote: > On Fri, Mar 26, 2021 at 10:38:30PM +0100, Klemens Nanni wrote: > > apm(8) never knows gets the result of the requested power action carried > > out by apmd(8), so platforms without suspend/resume support behave like > > this: > > >

Re: apmd/apm: propagate failure to apm, make apm report failure

2021-03-26 Thread Klemens Nanni
On Fri, Mar 26, 2021 at 10:38:30PM +0100, Klemens Nanni wrote: > apm(8) never knows gets the result of the requested power action carried > out by apmd(8), so platforms without suspend/resume support behave like > this: > > $ zzz; echo $? > Suspending system... > 0 > $ apm

apmd/apm: propagate failure to apm, make apm report failure

2021-03-26 Thread Klemens Nanni
apm(8) never knows gets the result of the requested power action carried out by apmd(8), so platforms without suspend/resume support behave like this: $ zzz; echo $? Suspending system... 0 $ apm -z; echo $? System will enter suspend mode momentarily.