Skip to content

Commit

Permalink
nuttx: replace getpid() with nxsched_getpid() in kernel code
Browse files Browse the repository at this point in the history
Signed-off-by: Petro Karashchenko <[email protected]>
  • Loading branch information
pkarashchenko authored and acassis committed Jul 7, 2023
1 parent 2ca40e1 commit 3fe371f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions net/netlink/netlink_attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
#include <assert.h>
#include <errno.h>
#include <debug.h>
#include <unistd.h>

#include <nuttx/sched.h>
#include <nuttx/net/netlink.h>

#include "netlink.h"
Expand Down Expand Up @@ -129,7 +129,7 @@ static int validate_nla(FAR const struct nlattr *nla, int maxtype,
if (g_nla_attr_len[pt->type] && attrlen != g_nla_attr_len[pt->type])
{
nwarn("netlink: '%d': attribute type %d has an invalid length.\n",
getpid(), type);
nxsched_getpid(), type);
return -EINVAL;
}

Expand Down Expand Up @@ -324,7 +324,7 @@ int nla_parse(FAR struct nlattr **tb, int maxtype,
if (rem > 0)
{
nwarn("netlink: %d bytes leftover after parsing attributes in "
"pid `%d'.\n", rem, getpid());
"pid `%d'.\n", rem, nxsched_getpid());
}

errout:
Expand Down
2 changes: 1 addition & 1 deletion sched/pthread/pthread_join.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ int pthread_join(pthread_t thread, FAR pthread_addr_t *pexit_value)
* ourself.
*/

if ((pid_t)thread == gettid())
if ((pid_t)thread == nxsched_gettid())
{
leave_cancellation_point();
return EDEADLK;
Expand Down

0 comments on commit 3fe371f

Please sign in to comment.