From dc4cdf7b00148703182649160309bdbb11fa6b5fdde795791a55852067757ba8 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Thu, 14 Jun 2007 14:18:25 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/util-linux?expand=0&rev=18 --- mkzimage_cmdline.c | 2 + util-linux-2.13-schedutils_chrt.patch | 67 +++++++++++++++++++++++++++ util-linux.changes | 12 +++++ util-linux.spec | 10 +++- 4 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 util-linux-2.13-schedutils_chrt.patch diff --git a/mkzimage_cmdline.c b/mkzimage_cmdline.c index b341627..a60edbc 100644 --- a/mkzimage_cmdline.c +++ b/mkzimage_cmdline.c @@ -93,6 +93,8 @@ int main(int argc, char **argv) exit(1); } set = 1; + if (!activate) + activate = 1; break; case 'v': my_version(); diff --git a/util-linux-2.13-schedutils_chrt.patch b/util-linux-2.13-schedutils_chrt.patch new file mode 100644 index 0000000..b1a01b1 --- /dev/null +++ b/util-linux-2.13-schedutils_chrt.patch @@ -0,0 +1,67 @@ +Index: util-linux-ng-2.12r+git20070530/schedutils/chrt.1 +=================================================================== +--- util-linux-ng-2.12r+git20070530.orig/schedutils/chrt.1 ++++ util-linux-ng-2.12r+git20070530/schedutils/chrt.1 +@@ -79,13 +79,13 @@ output version information and exit + .SH USAGE + .TP + The default behavior is to run a new command:: +-chrt [prio] [command] [arguments] ++chrt prio command [arguments] + .TP + You can also retrieve the real-time attributes of an existing task: +-chrt -p [pid] ++chrt -p pid + .TP + Or set them: +-chrt -p [prio] [pid] ++chrt -p prio pid + .SH PERMISSIONS + A user must possess + .BR CAP_SYS_NICE +Index: util-linux-ng-2.12r+git20070530/schedutils/chrt.c +=================================================================== +--- util-linux-ng-2.12r+git20070530.orig/schedutils/chrt.c ++++ util-linux-ng-2.12r+git20070530/schedutils/chrt.c +@@ -46,7 +46,7 @@ static void show_usage(const char *cmd) + fprintf(stderr, " -b, --batch " + "set policy to SCHED_BATCH\n"); + fprintf(stderr, " -f, --fifo " +- "set policy to SCHED_FF\n"); ++ "set policy to SCHED_FIFO\n"); + fprintf(stderr, " -p, --pid " + "operate on existing given pid\n"); + fprintf(stderr, " -m, --max " +@@ -146,7 +146,7 @@ int main(int argc, char *argv[]) + { + int i, policy = SCHED_RR, priority = 0, verbose = 0; + struct sched_param sp; +- pid_t pid = 0; ++ pid_t pid = -1; + + struct option longopts[] = { + { "batch", 0, NULL, 'b' }, +@@ -205,12 +205,12 @@ int main(int argc, char *argv[]) + + } + +- if ((pid && argc - optind < 1) || (!pid && argc - optind < 2)) { ++ if (((pid > -1) && argc - optind < 1) || ((pid == -1) && argc - optind < 2)) { + show_usage(argv[0]); + return 1; + } + +- if (pid && (verbose || argc - optind == 1)) { ++ if ((pid > -1) && (verbose || argc - optind == 1)) { + show_rt_info("current", pid); + if (argc - optind == 1) + return 0; +@@ -224,6 +224,8 @@ int main(int argc, char *argv[]) + return 1; + } + ++ if (pid == -1) ++ pid = 0; + sp.sched_priority = priority; + if (sched_setscheduler(pid, policy, &sp) == -1) { + perror("sched_setscheduler"); diff --git a/util-linux.changes b/util-linux.changes index 32338d0..9eb8c12 100644 --- a/util-linux.changes +++ b/util-linux.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Thu Jun 14 10:52:25 CEST 2007 - mkoenig@suse.de + +- mkzimage_cmdline: activate commandline if used with -s [#279935] + +------------------------------------------------------------------- +Wed Jun 13 12:33:59 CEST 2007 - mkoenig@suse.de + +- schedutils: let chrt accept pid 0 for current process and + fix some documentation bugs [#266879] + util-linux-2.13-schedutils_chrt.patch + ------------------------------------------------------------------- Wed Jun 6 16:15:43 CEST 2007 - mkoenig@suse.de diff --git a/util-linux.spec b/util-linux.spec index 1341c84..c387442 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -21,7 +21,7 @@ License: BSD License and BSD-like, GNU General Public License (GPL) Group: System/Base Autoreqprov: on Version: 2.12r+git20070530 -Release: 1 +Release: 5 Summary: A collection of basic system utilities Source: ftp://ftp.kernel.org/pub/linux/utils/util-linux/%name-ng-%version.tar.bz2 Source2: nologin.c @@ -97,6 +97,7 @@ Patch38: util-linux-2.12r-mount_swapon_swsuspend_resume.patch Patch40: util-linux-2.13-sys_utils_arch.patch Patch42: util-linux-2.13-build_fix_intel_check.patch Patch43: util-linux-2.13-misc_utils_cal_ncurses.patch +Patch44: util-linux-2.13-schedutils_chrt.patch ## ## adjtimex ## @@ -155,6 +156,7 @@ Authors: %patch40 -p1 %patch42 -p1 %patch43 -p1 +%patch44 -p1 # cd adjtimex-* %patch50 -p1 @@ -553,6 +555,12 @@ fi %endif %changelog +* Thu Jun 14 2007 - mkoenig@suse.de +- mkzimage_cmdline: activate commandline if used with -s [#279935] +* Wed Jun 13 2007 - mkoenig@suse.de +- schedutils: let chrt accept pid 0 for current process and + fix some documentation bugs [#266879] + util-linux-2.13-schedutils_chrt.patch * Wed Jun 06 2007 - mkoenig@suse.de - update to git20070530 - removed patches