...
Non-Compliant Code Example
| Code Block | ||
|---|---|---|
| ||
if(!fgets(filename, sizeof(filename), stdio)) {
/* handle error */
}
if(!open(filename, O_RDONLY, 0600)) {
/* handle error */
}
/* if filename is a fifo or a locked device the program will now hang in the open call */
|
Compliant Code Example (POSIX)
...