#include <sys/stat.h>
#include <sys/file.h>
#include <sys/socket.h>
+#include <sys/sysmacros.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <sys/select.h>
{
/* try a modprobe */
- system("/sbin/modprobe i2c_dev");
- system("/sbin/modprobe i2c_bcm2835");
+ if (system("/sbin/modprobe i2c_dev") == -1) { /* ignore errors */}
+ if (system("/sbin/modprobe i2c_bcm2835") == -1) { /* ignore errors */}
myGpioDelay(100000);
if (fd >= 0)
{
- if (setting) write(fd, "1\n", 2); else write(fd, "0\n", 2);
+ if (setting)
+ {
+ if (write(fd, "1\n", 2) == -1) { /* ignore errors */ }
+ }
+ else
+ {
+ if (write(fd, "0\n", 2) == -1) { /* ignore errors */ }
+ }
close(fd);
}
tp->id,
(unsigned)tp->nextTick.tv_sec,
(unsigned)tp->nextTick.tv_nsec);
- fprintf(stderr, buf);
+ fprintf(stderr, "%s", buf);
}
}
break;
case 5:
- fprintf(outFifo, cmdUsage);
+ fprintf(outFifo, "%s", cmdUsage);
break;
case 6:
p[3] = myDoCommand(p, sizeof(buf)-1, buf);
}
- write(sock, p, 16);
+ if (write(sock, p, 16) == -1) { /* ignore errors */ }
switch (p[0])
{
if (((int)p[3]) > 0)
{
- write(sock, buf, p[3]);
+ if (write(sock, buf, p[3]) == 1) { /* ignore errors */ }
}
break;
{
sprintf(pidStr, "%d\n", (int)getpid());
- write(fd, pidStr, strlen(pidStr));
+ if (write(fd, pidStr, strlen(pidStr)) == -1)
+ {
+ /* ignore errors */
+ }
}
else
{
pfd.events = POLLPRI;
lseek(fd, 0, SEEK_SET); /* consume any prior interrupt */
- read(fd, buf, sizeof buf);
+ if (read(fd, buf, sizeof buf) == -1) { /* ignore errors */ }
while (1)
{
if (retval >= 0)
{
lseek(fd, 0, SEEK_SET); /* consume interrupt */
- read(fd, buf, sizeof buf);
+ if (read(fd, buf, sizeof buf) == -1) { /* ignore errors */ }
if (retval)
{
char match[PI_MAX_PATH];
char buffer[PI_MAX_PATH];
char line[PI_MAX_PATH];
- char mperm;
+ char mperm=0;
char perm;
char term;
FILE *f;