sqc 0.4.13

Software Code Quality - CERT C compliance checker
/*
 * Rule: FIO42-C
 * Source: wiki
 * Status: PASS - Should NOT trigger FIO42-C violation
 */

#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
 
int func(const char *filename) {
  int fd = open(filename, O_RDONLY, S_IRUSR);
  if (-1 == fd) {
    return -1
  }
  /* ... */
  if (-1 == close(fd)) {
    return -1;
  }
  return 0;
}