lkml.org 
[lkml]   [2006]   [Aug]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [patch] fix posix timer errors
    On Sun, 13 Aug 2006 16:32:00 +0200
    Frederik Deweerdt <deweerdt@free.fr> wrote:

    > On Sun, Aug 13, 2006 at 01:24:54AM -0700, Andrew Morton wrote:
    > >
    > > ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.18-rc4/2.6.18-rc4-mm1/
    > >
    > Hi,
    >
    > posix-timers-fix-clock_nanosleep-doesnt-return-the-remaining-time-in-compatibility-mode.patch
    > declares two functions with the wrong return type.
    >
    > Also, posix-timers-fix-the-flags-handling-in-posix_cpu_nsleep.patch uses
    > '=' instead of '=='.
    >
    > The attached patch fix both issues.
    >

    Thanks.

    >
    > diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c
    > index 1fc1ea2..479b16b 100644
    > --- a/kernel/posix-cpu-timers.c
    > +++ b/kernel/posix-cpu-timers.c
    > @@ -1477,7 +1477,7 @@ int posix_cpu_nsleep(const clockid_t whi
    >
    > error = do_cpu_nanosleep(which_clock, flags, rqtp, &it);
    >
    > - if (error = -ERESTART_RESTARTBLOCK) {
    > + if (error == -ERESTART_RESTARTBLOCK) {
    >
    > if (flags & TIMER_ABSTIME)
    > return -ERESTARTNOHAND;
    > @@ -1511,7 +1511,7 @@ long posix_cpu_nsleep_restart(struct res
    > restart_block->fn = do_no_restart_syscall;
    > error = do_cpu_nanosleep(which_clock, TIMER_ABSTIME, &t, &it);
    >
    > - if (error = -ERESTART_RESTARTBLOCK) {
    > + if (error == -ERESTART_RESTARTBLOCK) {

    This is the sort of thing which should have been caught in testing, but it
    wasn't, which raises questions about how well-tested the rest of it is?

    Plus it will have generated compiler warnings.
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2006-08-13 19:27    [W:4.170 / U:0.036 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site