On Sun, 25 May 2014 12:46:46 -0000, Pietro Paolini said:

>         if ((fd = open(FILENAME, O_RDWR) == -1)) {

This sort of whoopsie is why most of the kernel uses this style:

        fd = open(FILENAME, O_RDWR);
        if (fd == -1) {

It may take an extra line of codde, but greatly reduces the chances of
commiting a operator precedence faux pas or similar bug....

Attachment: pgpJQURpGFNjD.pgp
Description: PGP signature

_______________________________________________
Kernelnewbies mailing list
[email protected]
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Reply via email to