mirror of https://github.com/citusdata/citus.git
Make static analysis happier (#4008)
Some small non-functional changes to make static analysis happy.pull/4000/head
parent
759e628dd5
commit
4c68ed4c33
|
@ -532,8 +532,9 @@ pg_get_tablecolumnoptionsdef_string(Oid tableRelationId)
|
|||
ereport(ERROR, (errmsg("bad number of tuple descriptor attributes")));
|
||||
}
|
||||
|
||||
AttrNumber natts = tupleDescriptor->natts;
|
||||
for (AttrNumber attributeIndex = 0;
|
||||
attributeIndex < (AttrNumber) tupleDescriptor->natts;
|
||||
attributeIndex < natts;
|
||||
attributeIndex++)
|
||||
{
|
||||
Form_pg_attribute attributeForm = TupleDescAttr(tupleDescriptor, attributeIndex);
|
||||
|
|
|
@ -1440,7 +1440,8 @@ TransformFunctionRTE(RangeTblEntry *rangeTblEntry)
|
|||
{
|
||||
ereport(ERROR, (errmsg("bad number of tuple descriptor attributes")));
|
||||
}
|
||||
for (targetColumnIndex = 0; targetColumnIndex < (AttrNumber) tupleDesc->natts;
|
||||
AttrNumber natts = tupleDesc->natts;
|
||||
for (targetColumnIndex = 0; targetColumnIndex < natts;
|
||||
targetColumnIndex++)
|
||||
{
|
||||
FormData_pg_attribute *attribute = TupleDescAttr(tupleDesc,
|
||||
|
|
|
@ -780,7 +780,12 @@ CitusRemoveDirectory(const char *filename)
|
|||
/* we now have an empty directory or a regular file, remove it */
|
||||
if (S_ISDIR(fileStat.st_mode))
|
||||
{
|
||||
removed = rmdir(filename);
|
||||
/*
|
||||
* We ignore the TOCTUO race condition static analysis warning
|
||||
* here, since we don't actually read the files or directories. We
|
||||
* simply want to remove them.
|
||||
*/
|
||||
removed = rmdir(filename); /* lgtm[cpp/toctou-race-condition] */
|
||||
|
||||
if (errno == ENOTEMPTY || errno == EEXIST)
|
||||
{
|
||||
|
@ -789,7 +794,12 @@ CitusRemoveDirectory(const char *filename)
|
|||
}
|
||||
else
|
||||
{
|
||||
removed = unlink(filename);
|
||||
/*
|
||||
* We ignore the TOCTUO race condition static analysis warning
|
||||
* here, since we don't actually read the files or directories. We
|
||||
* simply want to remove them.
|
||||
*/
|
||||
removed = unlink(filename); /* lgtm[cpp/toctou-race-condition] */
|
||||
}
|
||||
|
||||
if (removed != 0 && errno != ENOENT)
|
||||
|
|
Loading…
Reference in New Issue