mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 03:45:50 +08:00
lib_ulimit: fix the variable uninit coverity issue
Build Documentation / build-html (push) Has been cancelled
Build Documentation / build-html (push) Has been cancelled
Initialize the rlim_max field in the rlp structure when handling UL_SETFSIZE command in ulimit(), resolving an uninitialized variable warning from Coverity static analysis. Signed-off-by: guoshichao <guoshichao@xiaomi.com>
This commit is contained in:
@@ -62,6 +62,7 @@ long ulimit(int cmd, long newlimit)
|
||||
case UL_SETFSIZE:
|
||||
{
|
||||
struct rlimit rlp;
|
||||
rlp.rlim_max = RLIM_INFINITY;
|
||||
rlp.rlim_cur = newlimit * 512UL;
|
||||
ret = setrlimit(RLIMIT_FSIZE, &rlp);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user