unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob 9a2ce006ca9722c83bebc5c810ca4b36df3c96f9 1178 bytes (raw)
name: gnu/packages/patches/reptyr-fix-gcc-7.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
 
This patch allows reptyr to build with gcc 7. It is taken from reptyr mainline patches
fa0d63f and b45fd92.

Patch by Nelson Elhage <nelhage@nelhage.com>.

diff --git a/attach.c b/attach.c
index bd8ef8c..8d9cbf8 100644
--- a/attach.c
+++ b/attach.c
@@ -389,8 +389,11 @@ int setup_steal_socket(struct steal_pty_state *steal) {
         return errno;
 
     steal->addr_un.sun_family = AF_UNIX;
-    snprintf(steal->addr_un.sun_path, sizeof(steal->addr_un.sun_path),
-             "%s/reptyr.sock", steal->tmpdir);
+    if (snprintf(steal->addr_un.sun_path, sizeof(steal->addr_un.sun_path),
+                 "%s/reptyr.sock", steal->tmpdir) >= sizeof(steal->addr_un.sun_path)) {
+        error("tmpdir path too long!");
+        return ENAMETOOLONG;
+    }
 
     if ((steal->sockfd = socket(AF_UNIX, SOCK_DGRAM, 0)) < 0)
         return errno;
diff --git a/platform/linux/linux.h b/platform/linux/linux.h
index 9e6b78a..3ec5a99 100644
--- a/platform/linux/linux.h
+++ b/platform/linux/linux.h
@@ -40,6 +40,7 @@
 #include <sys/ptrace.h>
 #include <asm/ptrace.h>
 #include <sys/types.h>
+#include <sys/sysmacros.h>
 #include <sys/user.h>
 #include <unistd.h>
 #include <stdlib.h>

debug log:

solving 9a2ce006c ...
found 9a2ce006c in https://yhetil.org/guix-patches/20170512173328.24467-1-m.othacehe@gmail.com/

applying [1/1] https://yhetil.org/guix-patches/20170512173328.24467-1-m.othacehe@gmail.com/
diff --git a/gnu/packages/patches/reptyr-fix-gcc-7.patch b/gnu/packages/patches/reptyr-fix-gcc-7.patch
new file mode 100644
index 000000000..9a2ce006c

1:18: trailing whitespace.
 
1:27: trailing whitespace.
 
Checking patch gnu/packages/patches/reptyr-fix-gcc-7.patch...
Applied patch gnu/packages/patches/reptyr-fix-gcc-7.patch cleanly.
warning: 2 lines add whitespace errors.

index at:
100644 9a2ce006ca9722c83bebc5c810ca4b36df3c96f9	gnu/packages/patches/reptyr-fix-gcc-7.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).