Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Jun 1998 00:03:36 -0700 (PDT)
From:      cts@internetcds.com
To:        freebsd-gnats-submit@FreeBSD.ORG
Subject:   misc/7039: sigwait doesn't init the return value.
Message-ID:  <199806240703.AAA19621@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         7039
>Category:       misc
>Synopsis:       sigwait doesn't init the return value.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 24 00:10:01 PDT 1998
>Last-Modified:
>Originator:     Craig Spannring
>Organization:
InternetCDS
>Release:        2.2.6 and 3.0
>Environment:
FreeBSD backmaster.cdsnet.net 3.0-CURRENT FreeBSD 3.0-CURRENT #2: Tue May  5 20:30:34 PDT 1998     root@backmaster.cdsnet.net:/n/FreeBSD/3.0-back2/src/sys/compile/BACK2  i386

FreeBSD bangkok.office.cdsnet.net 2.2.6-STABLE FreeBSD 2.2.6-STABLE #1: Tue Apr\
 28 16:38:57 PDT 1998     root@bangkok.office.cdsnet.net:/usr/src/sys/compile/B\
ANGKOK  i386

>Description:
As you can see from the source code below the uthread_sigwait function
never assigns a value to 'ret'.



int
sigwait(const sigset_t * set, int *sig)
{
        int ret;
        int status;
        sigset_t oset;

        /* Block signals: */
        _thread_kern_sig_block(&status);

        /* Save the current sigmal mask: */
        oset = _thread_run->sigmask;

        /* Combine the caller's mask with the current one: */
        _thread_run->sigmask |= *set;

        /* Wait for a signal: */
        _thread_kern_sched_state(PS_SIGWAIT, __FILE__, __LINE__);

        /* Block signals again: */
        _thread_kern_sig_block(NULL);

        /* Return the signal number to the caller: */
        *sig = _thread_run->signo;

        /* Restore the signal mask: */
        _thread_run->sigmask = oset;

        /* Unblock signals: */
        _thread_kern_sig_unblock(status);

        /* Return the completion status: */
        return (ret);
}

>How-To-Repeat:

>Fix:
I don't have a copy of the posix standard
so I don't know what the proper return value
should be.

Sorry.
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199806240703.AAA19621>