mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-19 02:17:37 +08:00
nshlib/nsh_fsutils.c: fix getpid_callback function read size
Commit 5330966
replaced local static buffer with malloc allocated
lib_get_pathbuffer. This however prevents the usage of sizeof(buffer)
in the follow up read function, therefore the read size has to be
specified as PATH_MAX - 1.
This fixes the functionality of pidof function call (and subsequently
pkill call that uses pidof).
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
This commit is contained in:
@@ -98,7 +98,7 @@ static int getpid_callback(FAR struct nsh_vtbl_s *vtbl,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
len = read(fd, buffer, sizeof(buffer) - 1);
|
len = read(fd, buffer, PATH_MAX - 1);
|
||||||
close(fd);
|
close(fd);
|
||||||
if (len < 0)
|
if (len < 0)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user