diff mbox series

nptl: Fix typo in error message

Message ID 20220929085738.12027-1-peterlin@andestech.com
State New
Headers show
Series nptl: Fix typo in error message | expand

Commit Message

Yu Chien Peter Lin Sept. 29, 2022, 8:57 a.m. UTC
Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com>
---
 nptl/tst-setuid2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Florian Weimer Sept. 29, 2022, 10:01 a.m. UTC | #1
* Yu Chien Peter Lin:

> Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com>
> ---
>  nptl/tst-setuid2.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/nptl/tst-setuid2.c b/nptl/tst-setuid2.c
> index aff3b1a97d..fed2671b01 100644
> --- a/nptl/tst-setuid2.c
> +++ b/nptl/tst-setuid2.c
> @@ -77,7 +77,7 @@ run_on_thread (void (*func) (void))
>  
>    ret = pthread_cond_signal (&cond_send);
>    if (ret != 0)
> -    FAIL ("pthread_mutex_lock (%s): %d", __func__, ret);
> +    FAIL ("pthread_cond_signal (send): %d", ret);
>  
>    ret = pthread_mutex_lock (&mutex);
>    if (ret != 0)
> @@ -87,7 +87,7 @@ run_on_thread (void (*func) (void))
>      {
>        ret = pthread_cond_wait (&cond_recv, &mutex);
>        if (ret != 0)
> -	FAIL ("pthread_mutex_wait (%s): %d", __func__, ret);
> +	FAIL ("pthread_cond_wait (recv): %d", ret);
>      }
>    ret = pthread_mutex_unlock (&mutex);
>    if (ret != 0)

Maybe introduce xpthread_cond_signal in a separate patch and use
xpthread_cond_signal and xpthread_cond_wait instead?  The latter
already exists.
Yu Chien Peter Lin Sept. 30, 2022, 2:28 p.m. UTC | #2
On Thu, Sep 29, 2022 at 12:01:38PM +0200, Florian Weimer wrote:
> * Yu Chien Peter Lin:
> 
> > Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com>
> > ---
> >  nptl/tst-setuid2.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/nptl/tst-setuid2.c b/nptl/tst-setuid2.c
> > index aff3b1a97d..fed2671b01 100644
> > --- a/nptl/tst-setuid2.c
> > +++ b/nptl/tst-setuid2.c
> > @@ -77,7 +77,7 @@ run_on_thread (void (*func) (void))
> >  
> >    ret = pthread_cond_signal (&cond_send);
> >    if (ret != 0)
> > -    FAIL ("pthread_mutex_lock (%s): %d", __func__, ret);
> > +    FAIL ("pthread_cond_signal (send): %d", ret);
> >  
> >    ret = pthread_mutex_lock (&mutex);
> >    if (ret != 0)
> > @@ -87,7 +87,7 @@ run_on_thread (void (*func) (void))
> >      {
> >        ret = pthread_cond_wait (&cond_recv, &mutex);
> >        if (ret != 0)
> > -	FAIL ("pthread_mutex_wait (%s): %d", __func__, ret);
> > +	FAIL ("pthread_cond_wait (recv): %d", ret);
> >      }
> >    ret = pthread_mutex_unlock (&mutex);
> >    if (ret != 0)
> 
> Maybe introduce xpthread_cond_signal in a separate patch and use
> xpthread_cond_signal and xpthread_cond_wait instead?  The latter
> already exists.

Hi, Florian

I would introduce xpthread_cond_signal with a new patch, and also use
test-driver.c, thanks for your suggestion.

Best regards,
Peter Lin
diff mbox series

Patch

diff --git a/nptl/tst-setuid2.c b/nptl/tst-setuid2.c
index aff3b1a97d..fed2671b01 100644
--- a/nptl/tst-setuid2.c
+++ b/nptl/tst-setuid2.c
@@ -77,7 +77,7 @@  run_on_thread (void (*func) (void))
 
   ret = pthread_cond_signal (&cond_send);
   if (ret != 0)
-    FAIL ("pthread_mutex_lock (%s): %d", __func__, ret);
+    FAIL ("pthread_cond_signal (send): %d", ret);
 
   ret = pthread_mutex_lock (&mutex);
   if (ret != 0)
@@ -87,7 +87,7 @@  run_on_thread (void (*func) (void))
     {
       ret = pthread_cond_wait (&cond_recv, &mutex);
       if (ret != 0)
-	FAIL ("pthread_mutex_wait (%s): %d", __func__, ret);
+	FAIL ("pthread_cond_wait (recv): %d", ret);
     }
   ret = pthread_mutex_unlock (&mutex);
   if (ret != 0)