int fd = -1;
std::string auditSocketPath("/tmp/.audit-trail.sock");
fd = open(auditSocketPath.c_str(), O_RDWR);
- if (fd > 0)
+ if (fd >= 0)
close(fd);
Display::printResult(Display::SUCCESS, "accessAuditSocketFile");
open_by_handle_at_result:
if (handle)
free(handle);
- if (mountFd > 0)
+ if (mountFd >= 0)
close(mountFd);
Display::printResult(ret, "open_by_handle_at(371) positive");
}
//restore
{
struct stat st;
- if (fd > 0)
+ if (fd >= 0)
close(fd);
if ((lstat(fileName.c_str(), &st) == 0) && (unlink(fileName.c_str()) != 0)) {
Display::printError();
{
int fd = -1;
fd = creat(smackPath.c_str(), 0644);
- if (fd > 0) {
+ if (fd >= 0) {
writeRet = write(fd, writeString.c_str(), writeString.size());
_unused(writeRet);
close(fd);
{
int fd = -1;
fd = creat(smackfsPath.c_str(), 0644);
- if (fd > 0) {
+ if (fd >= 0) {
writeRet = write(fd, writeString.c_str(), writeString.size());
_unused(writeRet);
close(fd);
{
int fd = -1;
fd = creat(cynaraPath.c_str(), 0644);
- if (fd > 0) {
+ if (fd >= 0) {
writeRet = write(fd, writeString.c_str(), writeString.size());
_unused(writeRet);
close(fd);
{
int fd = -1;
fd = creat(netherPath.c_str(), 0644);
- if (fd > 0) {
+ if (fd >= 0) {
writeRet = write(fd, writeString.c_str(), writeString.size());
_unused(writeRet);
close(fd);