2
1

0003-src-pipe.c-fix-build-error-with-gcc-7.x.patch 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. From 167042116f523f90911f3a28c4ec065918d56cc9 Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  3. Date: Tue, 22 Aug 2017 00:02:52 +0200
  4. Subject: [PATCH] src/pipe.c: fix build error with gcc 7.x
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. The write function takes a char* as argument, not a char.
  9. Fixes:
  10. pipe.cpp: In member function ‘void DBus::Pipe::signal()’:
  11. pipe.cpp:86:29: error: invalid conversion from ‘char’ to ‘const void*’ [-fpermissive]
  12. ::write(_fd_write, '\0', 1);
  13. ^
  14. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  15. ---
  16. src/pipe.cpp | 2 +-
  17. 1 file changed, 1 insertion(+), 1 deletion(-)
  18. diff --git a/src/pipe.cpp b/src/pipe.cpp
  19. index 01211b3..d0572c7 100644
  20. --- a/src/pipe.cpp
  21. +++ b/src/pipe.cpp
  22. @@ -83,5 +83,5 @@ ssize_t Pipe::read(void *buffer, unsigned int &nbytes)
  23. void Pipe::signal()
  24. {
  25. // TODO: ignoring return of read/write generates warning; maybe relevant for eventloop work...
  26. - ::write(_fd_write, '\0', 1);
  27. + ::write(_fd_write, "\0", 1);
  28. }
  29. --
  30. 2.9.4