mmap(): enodev

Valdis.Kletnieks at vt.edu Valdis.Kletnieks at vt.edu
Sun May 25 10:28:24 EDT 2014


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....
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 848 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140525/d7c9c21e/attachment.bin 


More information about the Kernelnewbies mailing list