You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.0 KiB

  1. --- a/linuxgpio.c
  2. +++ b/linuxgpio.c
  3. @@ -66,7 +66,7 @@ static int linuxgpio_export(unsigned int
  4. return fd;
  5. }
  6. - len = snprintf(buf, sizeof(buf), "%ud", gpio);
  7. + len = snprintf(buf, sizeof(buf), "%u", gpio);
  8. r = write(fd, buf, len);
  9. close(fd);
  10. @@ -84,7 +84,7 @@ static int linuxgpio_unexport(unsigned i
  11. return fd;
  12. }
  13. - len = snprintf(buf, sizeof(buf), "%ud", gpio);
  14. + len = snprintf(buf, sizeof(buf), "%u", gpio);
  15. r = write(fd, buf, len);
  16. close(fd);
  17. @@ -95,7 +95,7 @@ static int linuxgpio_openfd(unsigned int
  18. {
  19. char filepath[60];
  20. - snprintf(filepath, sizeof(filepath), "/sys/class/gpio/gpio%ud/value", gpio);
  21. + snprintf(filepath, sizeof(filepath), "/sys/class/gpio/gpio%u/value", gpio);
  22. return (open(filepath, O_RDWR));
  23. }
  24. @@ -104,7 +104,7 @@ static int linuxgpio_dir(unsigned int gp
  25. int fd, r;
  26. char buf[60];
  27. - snprintf(buf, sizeof(buf), "/sys/class/gpio/gpio%ud/direction", gpio);
  28. + snprintf(buf, sizeof(buf), "/sys/class/gpio/gpio%u/direction", gpio);
  29. fd = open(buf, O_WRONLY);
  30. if (fd < 0) {