From 08214c9715fb0c0d8960399e9a36d4fd5c73da42 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Sat, 13 Jan 2018 20:43:16 +0100 Subject: [PATCH] reptyr: fix build with gcc 7. --- srcpkgs/reptyr/patches/gcc7.patch | 48 +++++++++++++++++++++++++++++++ srcpkgs/reptyr/template | 4 +-- 2 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 srcpkgs/reptyr/patches/gcc7.patch diff --git a/srcpkgs/reptyr/patches/gcc7.patch b/srcpkgs/reptyr/patches/gcc7.patch new file mode 100644 index 00000000000..31fd69274ed --- /dev/null +++ b/srcpkgs/reptyr/patches/gcc7.patch @@ -0,0 +1,48 @@ +From fa0d63ff8c488be15976e5353580b565e85586a1 Mon Sep 17 00:00:00 2001 +From: Nelson Elhage +Date: Sat, 18 Feb 2017 16:36:40 -0800 +Subject: [PATCH 1/2] Placate a gcc7 warning. + +(And handle a too-long temp directory with an error instead of a likely +crash) +--- + attach.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +--- attach.c ++++ 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; + +From b45fd9238958fcf2d8f3d6fc23e6d491febea2ac Mon Sep 17 00:00:00 2001 +From: Nelson Elhage +Date: Sat, 18 Feb 2017 16:38:18 -0800 +Subject: [PATCH 2/2] Include sysmacros.h + +See #81 +--- + platform/linux/linux.h | 1 + + 1 file changed, 1 insertion(+) + +--- platform/linux/linux.h ++++ platform/linux/linux.h +@@ -40,6 +40,7 @@ + #include + #include + #include ++#include + #include + #include + #include diff --git a/srcpkgs/reptyr/template b/srcpkgs/reptyr/template index b7a60bde8fe..ddb5b6ae9b4 100644 --- a/srcpkgs/reptyr/template +++ b/srcpkgs/reptyr/template @@ -1,11 +1,11 @@ # Template file for 'reptyr' pkgname=reptyr version=0.6.2 -revision=2 +revision=3 wrksrc="${pkgname}-${pkgname}-${version}" build_style=gnu-makefile short_desc="Reparent a running program to a new terminal" -maintainer="Christian Neukirchen " +maintainer="Leah Neukirchen " license="MIT" homepage="https://github.com/nelhage/reptyr" distfiles="https://github.com/nelhage/reptyr/archive/${pkgname}-${version}.tar.gz"