Commit 3276170e authored by Boris Nagaev's avatar Boris Nagaev Committed by Sigmanificient
Browse files

daemonize: fix build

Include PR https://github.com/bmc/daemonize/pull/39
It fixes daemonize after GCC update to 15.
parent b531851e
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
diff --git a/getopt.c b/getopt.c
index 9b27812..3fac396 100644
--- a/getopt.c
+++ b/getopt.c
@@ -43,9 +43,9 @@
 #include <stdio.h>
 /* We're ANSI now; we're guaranteed to have strchr(). */
 #include <string.h>
+#include <unistd.h>
 
 #define ERR(s, c)	if(x_opterr){\
-	extern int write();\
 	char errbuf[2];\
 	errbuf[0] = c; errbuf[1] = '\n';\
 	(void) write(2, argv[0], (unsigned)strlen(argv[0]));\
+7 −0
Original line number Diff line number Diff line
@@ -15,6 +15,13 @@ stdenv.mkDerivation rec {
    sha256 = "1e6LZXf/lK7sB2CbXwOg7LOi0Q8IBQNAa4d7rX0Ej3A=";
  };

  patches = [
    # conbination of:
    # https://github.com/bmc/daemonize/commit/eaf4746d47e171e7b8655690eb1e91fc216f2866
    # https://github.com/bmc/daemonize/pull/39
    ./include-write-prototype.patch
  ];

  meta = {
    description = "Runs a command as a Unix daemon";
    homepage = "http://software.clapper.org/daemonize/";