Common shared memory module. Using O_CLOEXEC for opened files.

This commit is contained in:
sorgelig
2021-04-16 23:12:46 +08:00
parent 2899437499
commit 9cd404ea65
22 changed files with 186 additions and 240 deletions

View File

@@ -115,7 +115,7 @@ static int smbus_open(int dev_address)
int fd;
sprintf(str, "/dev/i2c-%d", bus);
if ((fd = open(str, O_RDWR)) < 0)
if ((fd = open(str, O_RDWR | O_CLOEXEC)) < 0)
{
printf("Unable to open I2C bus %s: %s\n", str, strerror(errno));
continue;