From a28c610ba9d7c7c1f09585a8197454f45be71322 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Fri, 15 Jan 2010 00:52:35 +0000 Subject: Drop change from 1:3.6.1p2-5 to disable cmsg_type check for file descriptor passing when running on Linux 2.0. The previous stable release of Debian dropped support for Linux 2.4, let alone 2.0, so this very likely has no remaining users depending on it. --- monitor_fdpass.c | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) (limited to 'monitor_fdpass.c') diff --git a/monitor_fdpass.c b/monitor_fdpass.c index 3d3a78391..4b9a066bc 100644 --- a/monitor_fdpass.c +++ b/monitor_fdpass.c @@ -32,7 +32,6 @@ #ifdef HAVE_SYS_UN_H #include #endif -#include #include #include @@ -41,29 +40,6 @@ #include "log.h" #include "monitor_fdpass.h" -static int -cmsg_type_is_broken(void) -{ - static int broken_cmsg_type = -1; - - if (broken_cmsg_type != -1) - return broken_cmsg_type; - else { - struct utsname uts; - /* If uname() fails, play safe and assume that cmsg_type - * isn't broken. - */ - if (!uname(&uts) && - strcmp(uts.sysname, "Linux") == 0 && - strncmp(uts.release, "2.0.", 4) == 0) - broken_cmsg_type = 1; - else - broken_cmsg_type = 0; - } - - return broken_cmsg_type; -} - int mm_send_fd(int sock, int fd) { @@ -176,11 +152,13 @@ mm_receive_fd(int sock) return -1; } - if (!cmsg_type_is_broken() && cmsg->cmsg_type != SCM_RIGHTS) { +#ifndef BROKEN_CMSG_TYPE + if (cmsg->cmsg_type != SCM_RIGHTS) { error("%s: expected type %d got %d", __func__, SCM_RIGHTS, cmsg->cmsg_type); return -1; } +#endif fd = (*(int *)CMSG_DATA(cmsg)); #endif return fd; -- cgit v1.2.3