Bug#711529: gnome-terminal: FTBFS on GNU/kFreeBSD

Emilio Pozuelo Monfort pochu at debian.org
Tue Jun 11 09:43:36 UTC 2013


On 07/06/13 16:13, Petr Salinger wrote:
> Package: gnome-terminal
> Version: 3.8.2-1
> Severity: serious
> Tags: patch
> User: debian-bsd at lists.debian.org
> Usertags: kfreebsd
> 
> 
> Hi,
> 
> the current version fails to build on GNU/kFreeBSD.
> The F_DUPFD_CLOEXEC is not widespread fcntl, see also changes between
> http://pubs.opengroup.org/onlinepubs/009695399/functions/fcntl.html
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/fcntl.html

Seems like a POSIX.2008 addition.

> Please allow also fallback variant.

The patch seems fine but given that F_DUPFD_CLOEXEC has been implemented in
FreeBSD[1], I wonder if the __linux__ test shouldn't be changed to a
HAVE_F_DUPFD_CLOEXEC check (or to a hurd one). How long do you think it'll take
for Debian's freebsd kernel to have that?

I'll look at making an upload later today. Thanks for the fix!

Regards,
Emilio

[1] http://www.freebsd.org/releases/8.4R/relnotes-detailed.html

> --- src/terminal-screen.c
> +++ src/terminal-screen.c
> @@ -190,8 +190,20 @@
>  static TerminalURLFlavour *url_regex_flavors;
>  static guint n_url_regexes;
> 
> +#ifdef __linux__
> +static inline int dup_cloexec(int fd, int hint)
> +{
> +  return fcntl (fd, F_DUPFD_CLOEXEC, hint);
> +}
> +#else
> +static inline int dup_cloexec(int fd, int hint)
> +{
> +  if ((fd = fcntl (fd, F_DUPFD, hint)) == -1)
> +    return -1;
> +  return fcntl (fd, F_SETFD, FD_CLOEXEC);
> +}
> +
>  /* See bug #697024 */
> -#ifndef __linux__
> 
>  #undef dup3
>  #define dup3 fake_dup3
> @@ -1342,7 +1355,7 @@
>        for (j = 0; j < n_fds; j++) {
>          if (fds[j] == target_fd) {
>            do {
> -            fd = fcntl (fds[j], F_DUPFD_CLOEXEC, 10);
> +            fd = dup_cloexec(fds[j], 10);
>            } while (fd == -1 && errno == EINTR);
>            if (fd == -1)
>              _exit (127);
> 
> _______________________________________________
> pkg-gnome-maintainers mailing list
> pkg-gnome-maintainers at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-gnome-maintainers
> 



More information about the pkg-gnome-maintainers mailing list