You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "yangyalei (via GitHub)" <gi...@apache.org> on 2023/07/28 03:50:34 UTC
[GitHub] [nuttx] yangyalei opened a new pull request, #9925: vfs: return OK when fsync dir
yangyalei opened a new pull request, #9925:
URL: https://github.com/apache/nuttx/pull/9925
vfs: return OK when fsync dir
Signed-off-by: yangyalei <ya...@xiaomi.com>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] pkarashchenko commented on a diff in pull request #9925: posix: fix ltp test errors
Posted by "pkarashchenko (via GitHub)" <gi...@apache.org>.
pkarashchenko commented on code in PR #9925:
URL: https://github.com/apache/nuttx/pull/9925#discussion_r1277657307
##########
include/signal.h:
##########
@@ -163,6 +163,7 @@
#define SIGXFSZ 25
#define SIGVTALRM 26
#define SIGPROF 27
+#define SIGWINCH 28
Review Comment:
Please add corresponding changes to `libs/libc/string/lib_strsignal.c`
##########
libs/libc/pwd/lib_getpwent.c:
##########
@@ -0,0 +1,165 @@
+/****************************************************************************
+ * libs/libc/pwd/lib_getpwent.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <string.h>
+#include <pwd.h>
+#include <errno.h>
+
+#include "pwd/lib_pwd.h"
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: setpwent
+ *
+ * Description:
+ * The setpwent() function rewinds to the beginning of the password
+ * database.
+ *
+ * Input Parameters:
+ * None.
+ *
+ * Returned Value:
+ * None
+ *
+ ****************************************************************************/
+
+void setpwent(void)
+{
+ g_passwd_index = 0;
+}
+
+/****************************************************************************
+ * Name: endpwent
+ *
+ * Description:
+ * The endpwent() function is used to close the password database after
+ * all processing has been performed.
+ *
+ * Input Parameters:
+ * None.
+ *
+ * Returned Value:
+ * None
+ *
+ ****************************************************************************/
+
+void endpwent(void)
+{
+ g_passwd_index = 0;
+}
+
+/****************************************************************************
+ * Name: getpwent
+ *
+ * Description:
+ * The getpwent() function returns a pointer to a structure
+ * containing the broken-out fields of a record from the password
+ * database.
+ *
+ * Input Parameters:
+ * None.
+ *
+ * Returned Value:
+ * The getpwent() function returns a pointer to a passwd structure,
+ * or NULL if there are no more entries or an error occurred. If an
+ * error occurs, errno is set to indicate the error. If one wants
+ * to check errno after the call, it should be set to zero before
+ * the call.
+ *
+ ****************************************************************************/
+
+FAR struct passwd *getpwent(void)
+{
+ FAR struct passwd *pwd;
+ getpwent_r(&g_passwd, g_passwd_buffer,
+ CONFIG_LIBC_PASSWD_LINESIZE, &pwd);
+ return pwd;
+}
+
+/****************************************************************************
+ * Name: getpwent_r
+ *
+ * Description:
+ * The functions getpwent_r() are the reentrant versions of getpwent().
+ * The former reads the next passwd entry from the stream
+ * initialized by setpwent().
+ *
+ * Input Parameters:
+ * pwd - contains the struct passwd that was read from the stream,
+ * if any.
+ * buf - contains additional strings, if any.
+ * buflen - specifies the size of buf.
+ * *result - returns a pointer to the struct passwd in *pwd.
+ *
+ * Returned Value:
+ * On success, return 0, and *pwbufp shall contain a pointer to the result.
+ * On failure, *pwbufp shall contain NULL. return an error an follows:
+ * ENOENT: No more password entries.
+ * ERANGE: Not enough buffer space. Specify a larger buffer and
+ * try again.
+ *
+ ****************************************************************************/
+
+int getpwent_r(FAR struct passwd *pwd,
+ FAR char *buf, size_t buflen,
+ FAR struct passwd **result)
+{
+ int ret;
+#ifdef CONFIG_LIBC_PASSWD_FILE
+ ret = pwd_findby_index(g_passwd_index, pwd, buf, buflen);
+ if (ret != 1)
+ {
+ *result = NULL;
+ return ret < 0 ? ret : ENOENT;
+ }
+
+ *result = pwd;
+ g_passwd_index++;
+ return OK;
+#else
+ if (g_passwd_index != 0)
+ {
+ /* The only known user is 'root', if index in not 0. Thus, report
+ * back that no match was found.
+ */
+
+ *result = NULL;
+ return ENOENT;
+ }
+
+ ret = getpwbuf_r(ROOT_UID, ROOT_GID, ROOT_NAME, ROOT_NAME, ROOT_DIR,
+ ROOT_SHELL, pwd, buf, buflen, result);
Review Comment:
```suggestion
ret = getpwbuf_r(ROOT_UID, ROOT_GID, ROOT_NAME, ROOT_NAME, ROOT_DIR,
ROOT_SHELL, pwd, buf, buflen, result);
```
##########
libs/libc/signal/sig_altstack.c:
##########
@@ -0,0 +1,73 @@
+/****************************************************************************
+ * libs/libc/signal/sig_altstack.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <signal.h>
+#include <errno.h>
+#include <string.h>
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: sigaltstack
+ *
+ * Description:
+ * The sigaltstack() function allows a process to define and examine the
+ * state of an alternate stack for signal handlers for the current thread.
+ * Signals that have been explicitly declared to execute on the alternate
+ * stack shall be delivered on the alternate stack.
+ *
+ ****************************************************************************/
+
+int sigaltstack(const stack_t *ss, stack_t *oss)
Review Comment:
```suggestion
int sigaltstack(FAR const stack_t *ss, FAR stack_t *oss)
```
##########
mm/umm_heap/umm_malloc.c:
##########
@@ -57,8 +57,16 @@ FAR void *malloc(size_t size)
return memalign(sizeof(FAR void *), size);
#else
+ FAR void *ret;
+
/* Use mm_malloc() because it implements the clear */
- return mm_malloc(USR_HEAP, size);
+ ret = mm_malloc(USR_HEAP, size);
+ if (!ret)
Review Comment:
```suggestion
if (ret == NULL)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 merged pull request #9925: posix: fix ltp test errors
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 merged PR #9925:
URL: https://github.com/apache/nuttx/pull/9925
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #9925: posix: fix ltp test errors
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #9925:
URL: https://github.com/apache/nuttx/pull/9925#discussion_r1277648953
##########
sched/pthread/pthread_create.c:
##########
@@ -196,9 +196,13 @@ int nx_pthread_create(pthread_trampoline_t trampoline, FAR pthread_t *thread,
if (!attr)
{
- /* Inherit parent priority by default */
+ /* Inherit parent priority by default. except idle */
+
+ if (parent->pid != IDLE_PROCESS_ID)
Review Comment:
call is_idle_task(parent) instead
##########
mm/umm_heap/umm_malloc.c:
##########
@@ -57,8 +57,16 @@ FAR void *malloc(size_t size)
return memalign(sizeof(FAR void *), size);
#else
+ FAR void *ret;
+
/* Use mm_malloc() because it implements the clear */
- return mm_malloc(USR_HEAP, size);
+ ret = mm_malloc(USR_HEAP, size);
+ if (!ret)
+ {
+ set_errno(ENOMEM);
Review Comment:
other allocation function need set_errno too
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] yangyalei commented on pull request #9925: posix: fix ltp test errors
Posted by "yangyalei (via GitHub)" <gi...@apache.org>.
yangyalei commented on PR #9925:
URL: https://github.com/apache/nuttx/pull/9925#issuecomment-1658038812
> please squash the ltp: patches
done @xiaoxiang781216
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org