usr/fileio: Suppress a Coverity complaint about 'page_size'

Suppress the following Coverity complaint:

    CID 361202:  Error handling issues  (NEGATIVE_RETURNS)
    "page_size" is passed to a parameter that cannot be negative.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9116 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2020-08-09 00:41:14 +00:00
parent 6138af9193
commit 31dbbf3274

View File

@@ -200,10 +200,12 @@ out:
static void *align_alloc(size_t size)
{
static uint32_t page_size;
static long page_size;
if (page_size == 0)
if (page_size == 0) {
page_size = sysconf(_SC_PAGESIZE);
assert(page_size > 0);
}
TRACE_MEM("Request to alloc %zdKB", size / 1024);
return memalign(page_size, size);