rpms/util-linux-ng/F-13 util-linux-ng-2.17-rtcwake-off.patch, NONE, 1.1 util-linux-ng.spec, 1.80, 1.81

kzak kzak at fedoraproject.org
Thu Apr 8 07:48:10 UTC 2010


Author: kzak

Update of /cvs/pkgs/rpms/util-linux-ng/F-13
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv19106

Modified Files:
	util-linux-ng.spec 
Added Files:
	util-linux-ng-2.17-rtcwake-off.patch 
Log Message:
* Thu Apr  8 2010 Karel Zak <kzak at redhat.com> 2.17.2-2
- fix #580296 - "rtcwake" does miss the "off" option


util-linux-ng-2.17-rtcwake-off.patch:
 rtcwake.c |   25 +++++++++++++++++++------
 1 file changed, 19 insertions(+), 6 deletions(-)

--- NEW FILE util-linux-ng-2.17-rtcwake-off.patch ---
>From ecd55f9647d139784857df994d0f5b965d164547 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak at redhat.com>
Date: Thu, 8 Apr 2010 08:51:00 +0200
Subject: [PATCH 1/2] rtcwake: does miss the "off" option

Reported-by: Piergiorgio Sartor <piergiorgio.sartor at nexgo.de>
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=580296
Signed-off-by: Karel Zak <kzak at redhat.com>
---
 sys-utils/rtcwake.c |   24 +++++++++++++++++++-----
 1 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/sys-utils/rtcwake.c b/sys-utils/rtcwake.c
index 7b2df26..344fed7 100644
--- a/sys-utils/rtcwake.c
+++ b/sys-utils/rtcwake.c
@@ -468,15 +468,19 @@ int main(int argc, char **argv)
 	fflush(stdout);
 	usleep(10 * 1000);
 
-	if (strcmp(suspend, "no") == 0)
+	if (strcmp(suspend, "no") == 0) {
+		if (verbose)
+			printf(_("suspend mode: no; leaving\n"));
+		close(fd);
 		exit(EXIT_SUCCESS);
-	else if (strcmp(suspend, "on") != 0) {
-		sync();
-		suspend_system(suspend);
+
 	} else if (strcmp(suspend, "off") == 0) {
 		char *arg[4];
 		int i = 0;
 
+		if (verbose)
+			printf(_("suspend mode: off; executing %s\n"),
+						_PATH_SHUTDOWN);
 		arg[i++] = _PATH_SHUTDOWN;
 		arg[i++] = "-P";
 		arg[i++] = "now";
@@ -487,9 +491,13 @@ int main(int argc, char **argv)
 		fprintf(stderr, _("%s: unable to execute %s: %s\n"),
 				progname, _PATH_SHUTDOWN, strerror(errno));
 		rc = EXIT_FAILURE;
-	} else {
+
+	} else if (strcmp(suspend, "on") == 0) {
 		unsigned long data;
 
+		if (verbose)
+			printf(_("suspend mode: on; reading rtc\n"));
+
 		do {
 			t = read(fd, &data, sizeof data);
 			if (t < 0) {
@@ -499,6 +507,12 @@ int main(int argc, char **argv)
 			if (verbose)
 				printf("... %s: %03lx\n", devname, data);
 		} while (!(data & RTC_AF));
+
+	} else {
+		if (verbose)
+			printf(_("suspend mode: %s; suspending system\n"), suspend);
+		sync();
+		suspend_system(suspend);
 	}
 
 	if (ioctl(fd, RTC_AIE_OFF, 0) < 0)
-- 
1.6.6



Index: util-linux-ng.spec
===================================================================
RCS file: /cvs/pkgs/rpms/util-linux-ng/F-13/util-linux-ng.spec,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -p -r1.80 -r1.81
--- util-linux-ng.spec	22 Mar 2010 09:54:39 -0000	1.80
+++ util-linux-ng.spec	8 Apr 2010 07:48:10 -0000	1.81
@@ -2,7 +2,7 @@
 Summary: A collection of basic system utilities
 Name: util-linux-ng
 Version: 2.17.2
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: GPLv2 and GPLv2+ and GPLv3+ and LGPLv2+ and BSD with advertising and Public Domain
 Group: System Environment/Base
 URL: ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng
@@ -108,6 +108,8 @@ Patch8: util-linux-ng-2.15-ipcs-32bit.pa
 ###
 # 575734 - use microsecond resolution for blkid cache entries
 Patch9: util-linux-ng-2.17-blkid-usec.patch
+# 580296 - "rtcwake" does miss the "off" option
+Patch10: util-linux-ng-2.17-rtcwake-off.patch
 
 %description
 The util-linux-ng package contains a large variety of low-level system
@@ -202,6 +204,7 @@ cp %{SOURCE8} %{SOURCE9} .
 %patch7 -p1
 %patch8 -p1
 %patch9 -p1
+%patch10 -p1
 
 %build
 unset LINGUAS || :
@@ -721,6 +724,9 @@ fi
 
 
 %changelog
+* Thu Apr  8 2010 Karel Zak <kzak at redhat.com> 2.17.2-2
+- fix #580296 - "rtcwake" does miss the "off" option
+
 * Mon Mar 22 2010 Karel Zak <kzak at redhat.com> 2.17.2-1
 - upgrade to the bugfix release 2.17.2
   ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.17/v2.17.2-ReleaseNotes



More information about the scm-commits mailing list