From 139456d3cb1a8c7be9e48d765eda23b15d8c8bad Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 3 Apr 2011 14:26:05 +0000 Subject: New LIS331DL driver and VSN updates from Uros git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3457 42af7a65-404d-4744-a932-0658087f49c3 --- apps/examples/ostest/mqueue.c | 6 +++--- apps/examples/ostest/sighand.c | 6 +++--- apps/examples/ostest/timedmqueue.c | 12 ++++++------ apps/namedapp/binfs.c | 2 +- apps/netutils/dhcpc/dhcpc.c | 4 ++-- apps/netutils/thttpd/thttpd_cgi.c | 2 +- apps/nshlib/nsh_apps.c | 7 ++++++- 7 files changed, 22 insertions(+), 17 deletions(-) (limited to 'apps') diff --git a/apps/examples/ostest/mqueue.c b/apps/examples/ostest/mqueue.c index e68cfc012..95e6bbfc8 100644 --- a/apps/examples/ostest/mqueue.c +++ b/apps/examples/ostest/mqueue.c @@ -1,5 +1,5 @@ /************************************************************************** - * mqueue.c + * apps/examples/ostest/mqueue.c * * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -212,9 +212,9 @@ static void *receiver_thread(void *arg) * it is not a failure. */ - if (*get_errno_ptr() != EINTR) + if (errno != EINTR) { - printf("receiver_thread: ERROR mq_receive failure on msg %d, errno=%d\n", i, *get_errno_ptr()); + printf("receiver_thread: ERROR mq_receive failure on msg %d, errno=%d\n", i, errno); nerrors++; } else diff --git a/apps/examples/ostest/sighand.c b/apps/examples/ostest/sighand.c index 46650be1c..66f98cb58 100644 --- a/apps/examples/ostest/sighand.c +++ b/apps/examples/ostest/sighand.c @@ -1,7 +1,7 @@ /*********************************************************************** - * examples/ostest/sighand.c + * apps/examples/ostest/sighand.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2008, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -160,7 +160,7 @@ static int waiter_main(int argc, char *argv[]) status = sem_wait(&sem); if (status != 0) { - int error = *get_errno_ptr(); + int error = errno; if (error == EINTR) { printf("waiter_main: sem_wait() successfully interrupted by signal\n" ); diff --git a/apps/examples/ostest/timedmqueue.c b/apps/examples/ostest/timedmqueue.c index 9c14ec414..49fe1c4c6 100644 --- a/apps/examples/ostest/timedmqueue.c +++ b/apps/examples/ostest/timedmqueue.c @@ -1,7 +1,7 @@ /************************************************************************** - * examples/ostest/mqueue.c + * apps/examples/ostest/mqueue.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -157,13 +157,13 @@ static void *sender_thread(void *arg) status = mq_timedsend(mqfd, msg_buffer, TEST_MSGLEN, 42, &time); if (status < 0) { - if (i == TEST_SEND_NMSGS-1 && *get_errno_ptr() == ETIMEDOUT) + if (i == TEST_SEND_NMSGS-1 && errno == ETIMEDOUT) { printf("sender_thread: mq_timedsend %d timed out as expected\n", i); } else { - printf("sender_thread: ERROR mq_timedsend failure=%d on msg %d\n", *get_errno_ptr(), i); + printf("sender_thread: ERROR mq_timedsend failure=%d on msg %d\n", errno, i); nerrors++; } } @@ -248,13 +248,13 @@ static void *receiver_thread(void *arg) nbytes = mq_timedreceive(mqfd, msg_buffer, TEST_MSGLEN, 0, &time); if (nbytes < 0) { - if (i == TEST_SEND_NMSGS-1 && *get_errno_ptr() == ETIMEDOUT) + if (i == TEST_SEND_NMSGS-1 && errno == ETIMEDOUT) { printf("receiver_thread: Receive %d timed out as expected\n", i); } else { - printf("receiver_thread: ERROR mq_timedreceive failure=%d on msg %d\n", *get_errno_ptr(), i); + printf("receiver_thread: ERROR mq_timedreceive failure=%d on msg %d\n", errno, i); nerrors++; } } diff --git a/apps/namedapp/binfs.c b/apps/namedapp/binfs.c index 15ed4cc88..a2f14dd75 100644 --- a/apps/namedapp/binfs.c +++ b/apps/namedapp/binfs.c @@ -156,7 +156,7 @@ static void binfs_semtake(struct binfs_state_s *bm) * the wait was awakened by a signal. */ - ASSERT(*get_errno_ptr() == EINTR); + ASSERT(errno == EINTR); } } diff --git a/apps/netutils/dhcpc/dhcpc.c b/apps/netutils/dhcpc/dhcpc.c index dc80988bb..b5551c6f1 100644 --- a/apps/netutils/dhcpc/dhcpc.c +++ b/apps/netutils/dhcpc/dhcpc.c @@ -492,7 +492,7 @@ int dhcpc_request(void *handle, struct dhcpc_state *presult) * Then loop and send the DISCOVER command again. */ - else if (*get_errno_ptr() != EAGAIN) + else if (errno != EAGAIN) { /* An error other than a timeout was received -- error out */ @@ -570,7 +570,7 @@ int dhcpc_request(void *handle, struct dhcpc_state *presult) * 3 times). */ - else if (*get_errno_ptr() != EAGAIN) + else if (errno != EAGAIN) { /* An error other than a timeout was received */ diff --git a/apps/netutils/thttpd/thttpd_cgi.c b/apps/netutils/thttpd/thttpd_cgi.c index ee126795a..3d2eb57b8 100755 --- a/apps/netutils/thttpd/thttpd_cgi.c +++ b/apps/netutils/thttpd/thttpd_cgi.c @@ -152,7 +152,7 @@ static inline void cgi_semtake(void) * awakened by a signal. */ - ASSERT(*get_errno_ptr() == EINTR); + ASSERT(errno == EINTR); } } diff --git a/apps/nshlib/nsh_apps.c b/apps/nshlib/nsh_apps.c index a8f9eb9bf..c41f2448a 100644 --- a/apps/nshlib/nsh_apps.c +++ b/apps/nshlib/nsh_apps.c @@ -46,6 +46,7 @@ #include #include +#include #include @@ -98,7 +99,8 @@ int nsh_execapp(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd, { int err = -errno; int i; - + +#ifndef CONFIG_APPS_BINDIR /* On failure, list the set of available built-in commands */ nsh_output(vtbl, "Builtin Apps: "); @@ -116,6 +118,9 @@ int nsh_execapp(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd, } return OK; +#else + return err; +#endif } #ifdef CONFIG_SCHED_WAITPID -- cgit v1.2.3