[Glibc-bsd-commits] r2474 - in trunk/web/patches/upstream-only: . util-linux-2.15rc2

Aurelien Jarno aurel32 at alioth.debian.org
Sun Apr 19 13:51:30 UTC 2009


Author: aurel32
Date: 2009-04-19 13:51:30 +0000 (Sun, 19 Apr 2009)
New Revision: 2474

Added:
   trunk/web/patches/upstream-only/util-linux-2.15rc2/
   trunk/web/patches/upstream-only/util-linux-2.15rc2/0001-lib-do-not-include-linux-fd.h-in-ismounted.c.patch
   trunk/web/patches/upstream-only/util-linux-2.15rc2/0002-schedutils-don-t-assume-SCHED_BATCH-and-SCHED_IDLE.patch
   trunk/web/patches/upstream-only/util-linux-2.15rc2/leftover.patch
Log:
Add preliminary util-linux-2.15rc2 patches


Added: trunk/web/patches/upstream-only/util-linux-2.15rc2/0001-lib-do-not-include-linux-fd.h-in-ismounted.c.patch
===================================================================
--- trunk/web/patches/upstream-only/util-linux-2.15rc2/0001-lib-do-not-include-linux-fd.h-in-ismounted.c.patch	                        (rev 0)
+++ trunk/web/patches/upstream-only/util-linux-2.15rc2/0001-lib-do-not-include-linux-fd.h-in-ismounted.c.patch	2009-04-19 13:51:30 UTC (rev 2474)
@@ -0,0 +1,28 @@
+From ccba4b30dc7ceb1ad951edfe688f0fc5989b6b36 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien at aurel32.net>
+Date: Sun, 19 Apr 2009 15:31:18 +0200
+Subject: [PATCH 1/2] lib: do not include <linux/fd.h> in ismounted.c
+
+<linux/fd.h> is included for no reason in lib/ismounted.c. This
+obviously breaks on non-Linux systems.
+
+Signed-off-by: Aurelien Jarno <aurelien at aurel32.net>
+---
+ lib/ismounted.c |    1 -
+ 1 files changed, 0 insertions(+), 1 deletions(-)
+
+diff --git a/lib/ismounted.c b/lib/ismounted.c
+index 0481c77..28ae325 100644
+--- a/lib/ismounted.c
++++ b/lib/ismounted.c
+@@ -11,7 +11,6 @@
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <fcntl.h>
+-#include <linux/fd.h>
+ #include <mntent.h>
+ #include <string.h>
+ #include <sys/stat.h>
+-- 
+1.6.2.3
+

Added: trunk/web/patches/upstream-only/util-linux-2.15rc2/0002-schedutils-don-t-assume-SCHED_BATCH-and-SCHED_IDLE.patch
===================================================================
--- trunk/web/patches/upstream-only/util-linux-2.15rc2/0002-schedutils-don-t-assume-SCHED_BATCH-and-SCHED_IDLE.patch	                        (rev 0)
+++ trunk/web/patches/upstream-only/util-linux-2.15rc2/0002-schedutils-don-t-assume-SCHED_BATCH-and-SCHED_IDLE.patch	2009-04-19 13:51:30 UTC (rev 2474)
@@ -0,0 +1,133 @@
+From 77c3ea852bb29303cc992e951351069d23bccd59 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien at aurel32.net>
+Date: Sun, 19 Apr 2009 15:47:17 +0200
+Subject: [PATCH 2/2] schedutils: don't assume SCHED_BATCH and SCHED_IDLE exist
+
+SCHED_FIFO, SCHED_OTHER, SCHED_RR are part of POSIX 1003.1b Process
+Scheduling, so it is correct to assume they always exists.
+
+SCHED_BATCH and SCHED_IDLE are Linux specific, we should not assume
+they exists.
+
+Signed-off-by: Aurelien Jarno <aurelien at aurel32.net>
+---
+ schedutils/chrt.c |   37 +++++++++++++++++++++++++++++++++----
+ 1 files changed, 33 insertions(+), 4 deletions(-)
+
+diff --git a/schedutils/chrt.c b/schedutils/chrt.c
+index dcd0524..6042168 100644
+--- a/schedutils/chrt.c
++++ b/schedutils/chrt.c
+@@ -34,7 +34,7 @@
+ /* the SCHED_BATCH is supported since Linux 2.6.16
+  *  -- temporary workaround for people with old glibc headers
+  */
+-#ifndef SCHED_BATCH
++#if defined (__linux__) && !defined(SCHED_BATCH)
+ # define SCHED_BATCH 3
+ #endif
+ 
+@@ -42,7 +42,7 @@
+  * commit id 0e6aca43e08a62a48d6770e9a159dbec167bf4c6
+  * -- temporary workaround for people with old glibc headers
+  */
+-#ifndef SCHED_IDLE
++#if defined (__linux__) && !defined(SCHED_IDLE)
+ # define SCHED_IDLE 5
+ #endif
+ 
+@@ -59,9 +59,13 @@ static void show_usage(int rc)
+ 	"\nGet policy:\n"
+ 	"  chrt [options] {<pid> | <command> [<arg> ...]}\n\n"
+ 	"\nScheduling policies:\n"
++#ifdef SCHED_BATCH
+ 	"  -b | --batch         set policy to SCHED_BATCH\n"
++#endif
+ 	"  -f | --fifo          set policy to SCHED_FIFO\n"
++#ifdef SCHED_IDLE
+ 	"  -i | --idle          set policy to SCHED_IDLE\n"
++#endif
+ 	"  -o | --other         set policy to SCHED_OTHER\n"
+ 	"  -r | --rr            set policy to SCHED_RR (default)\n"
+ 	"\nOptions:\n"
+@@ -95,15 +99,19 @@ static void show_rt_info(const char *what, pid_t pid)
+ 	case SCHED_FIFO:
+ 		printf("SCHED_FIFO\n");
+ 		break;
++#ifdef SCHED_IDLE
+ 	case SCHED_IDLE:
+ 		printf("SCHED_IDLE\n");
+ 		break;
++#endif
+ 	case SCHED_RR:
+ 		printf("SCHED_RR\n");
+ 		break;
++#ifdef SCHED_BATCH
+ 	case SCHED_BATCH:
+ 		printf("SCHED_BATCH\n");
+ 		break;
++#endif
+ 	default:
+ 		printf(_("unknown\n"));
+ 	}
+@@ -119,8 +127,21 @@ static void show_min_max(void)
+ {
+ 	int i;
+ 	int policies[] = { SCHED_OTHER, SCHED_FIFO, SCHED_RR,
+-			   SCHED_BATCH, SCHED_IDLE };
+-	const char *names[] = { "OTHER", "FIFO", "RR", "BATCH", "IDLE" };
++#ifdef SCHED_BATCH
++			   SCHED_BATCH,
++#endif
++#ifdef SCHED_IDLE
++			   SCHED_IDLE,
++#endif
++			 };
++	const char *names[] = { "OTHER", "FIFO", "RR",
++#ifdef SCHED_BATCH
++				"BATCH",
++#endif
++#ifdef SCHED_IDLE
++				"IDLE",
++#endif
++			      };
+ 
+ 	for (i = 0; i < ARRAY_SIZE(policies); i++) {
+ 		int max = sched_get_priority_max(policies[i]);
+@@ -141,9 +162,13 @@ int main(int argc, char *argv[])
+ 	pid_t pid = -1;
+ 
+ 	struct option longopts[] = {
++#ifdef SCHED_BATCH
+ 		{ "batch",	0, NULL, 'b' },
++#endif
+ 		{ "fifo",	0, NULL, 'f' },
++#ifdef SCHED_IDLE
+ 		{ "idle",	0, NULL, 'i' },
++#endif
+ 		{ "pid",	0, NULL, 'p' },
+ 		{ "help",	0, NULL, 'h' },
+ 		{ "max",        0, NULL, 'm' },
+@@ -163,15 +188,19 @@ int main(int argc, char *argv[])
+ 		int ret = EXIT_FAILURE;
+ 
+ 		switch (i) {
++#ifdef SCHED_BATCH
+ 		case 'b':
+ 			policy = SCHED_BATCH;
+ 			break;
++#endif
+ 		case 'f':
+ 			policy = SCHED_FIFO;
+ 			break;
++#ifdef SCHED_IDLE
+ 		case 'i':
+ 			policy = SCHED_IDLE;
+ 			break;
++#endif
+ 		case 'm':
+ 			show_min_max();
+ 			return 0;
+-- 
+1.6.2.3
+

Added: trunk/web/patches/upstream-only/util-linux-2.15rc2/leftover.patch
===================================================================
--- trunk/web/patches/upstream-only/util-linux-2.15rc2/leftover.patch	                        (rev 0)
+++ trunk/web/patches/upstream-only/util-linux-2.15rc2/leftover.patch	2009-04-19 13:51:30 UTC (rev 2474)
@@ -0,0 +1,101 @@
+diff --git a/login-utils/Makefile.am b/login-utils/Makefile.am
+index 5ed581b..0386cee 100644
+--- a/login-utils/Makefile.am
++++ b/login-utils/Makefile.am
+@@ -11,6 +11,7 @@ EXTRA_DIST = README.getty  README.modems-with-agetty  README.poeigl
+ if BUILD_AGETTY
+ sbin_PROGRAMS += agetty
+ dist_man_MANS += agetty.8
++agetty_LDADD = -lutil
+ endif
+ 
+ if BUILD_INIT
+diff --git a/login-utils/agetty.c b/login-utils/agetty.c
+index 29ce149..500d7b3 100644
+--- a/login-utils/agetty.c
++++ b/login-utils/agetty.c
+@@ -37,7 +37,7 @@
+ #include "nls.h"
+ #include "pathnames.h"
+ 
+-#ifdef __linux__
++#if defined(__linux__) || defined(__FreeBSD_kernel__)
+ #include <sys/param.h>
+ #define USE_SYSLOG
+ #endif
+@@ -281,9 +281,7 @@ main(argc, argv)
+ 
+     parse_args(argc, argv, &options);
+ 
+-#ifdef __linux__
+ 	setsid();
+-#endif
+ 	
+     /* Update the utmp file. */
+ 
+@@ -670,6 +668,13 @@ open_tty(tty, tp, local)
+     if (tcgetattr(0, tp) < 0)
+ 	error("%s: tcgetattr: %m", tty);
+ 
++     /*
++     * login_tty: steal tty from other process group.
++     */
++#if defined(__FreeBSD_kernel__)
++    login_tty (0);
++#endif
++
+     /*
+      * It seems to be a terminal. Set proper protections and ownership. Mode
+      * 0622 is suitable for SYSV <4 because /bin/login does not change
+@@ -1146,11 +1151,15 @@ termio_final(op, tp, cp)
+     /* Account for upper case without lower case. */
+ 
+     if (cp->capslock) {
++#ifdef IUCLC
+ 	tp->c_iflag |= IUCLC;
++#endif
+ #ifdef XCASE	
+ 	tp->c_lflag |= XCASE;
+ #endif
++#ifdef OLCUC
+ 	tp->c_oflag |= OLCUC;
++#endif
+     }
+     /* Optionally enable hardware flow control */
+ 
+diff --git a/sys-utils/ipcs.c b/sys-utils/ipcs.c
+index 55d5c80..f0243e3 100644
+--- a/sys-utils/ipcs.c
++++ b/sys-utils/ipcs.c
+@@ -246,6 +246,7 @@ print_perms (int id, struct ipc_perm *ipcp) {
+ 
+ void do_shm (char format)
+ {
++#if 0
+ 	int maxid, shmid, id;
+ 	struct shmid_ds shmseg;
+ 	struct shm_info shm_info;
+@@ -368,6 +369,7 @@ void do_shm (char format)
+ 		}
+ 	}
+ 	return;
++#endif
+ }
+ 
+ 
+@@ -475,6 +477,7 @@ void do_sem (char format)
+ 
+ void do_msg (char format)
+ {
++#if 0
+ 	int maxid, msqid, id;
+ 	struct msqid_ds msgque;
+ 	struct msginfo msginfo;
+@@ -581,6 +584,7 @@ void do_msg (char format)
+ 		}
+ 	}
+ 	return;
++#endif
+ }
+ 
+ 




More information about the Glibc-bsd-commits mailing list