FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Kubuntu Development

 
 
LinkBack Thread Tools
 
Old 01-14-2010, 07:52 PM
David Cantrell
 
Default reIPL code cleanup in loader

Fixes from here:
https://www.redhat.com/archives/anaconda-devel-list/2009-December/msg00473.html

--
David Cantrell <dcantrell@redhat.com>
Red Hat / Honolulu, HI

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 01-14-2010, 07:52 PM
David Cantrell
 
Default reIPL code cleanup in loader

Hans' fixes from this message:
https://www.redhat.com/archives/anaconda-devel-list/2009-December/msg00473.html

Keeping the code consistent across master, rhel6-branch, and
rhel5-branch.
---
loader/loader.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/loader/loader.c b/loader/loader.c
index 6db3d7c..22c566f 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -1809,11 +1809,10 @@ int main(int argc, char ** argv) {
/* get init PID if we have it */
if ((f = fopen("/var/run/init.pid", "r")) != NULL) {
char linebuf[256];
- memset(linebuf, '', sizeof(linebuf));

- while (fgets(linebuf, sizeof(linebuf) - 1, f) != NULL) {
+ while (fgets(linebuf, sizeof(linebuf), f) != NULL) {
errno = 0;
- init_pid = strtol((const char *) &linebuf, NULL, 10);
+ init_pid = strtol(linebuf, NULL, 10);
if (errno == EINVAL || errno == ERANGE) {
logMessage(ERROR, "%s (%d): %m", __func__, __LINE__);
init_pid = 1;
--
1.6.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 01-14-2010, 10:16 PM
David Lehman
 
Default reIPL code cleanup in loader

On Thu, 2010-01-14 at 10:52 -1000, David Cantrell wrote:
> Hans' fixes from this message:
> https://www.redhat.com/archives/anaconda-devel-list/2009-December/msg00473.html
>
> Keeping the code consistent across master, rhel6-branch, and
> rhel5-branch.

Looks good.

Dave

> ---
> loader/loader.c | 5 ++---
> 1 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/loader/loader.c b/loader/loader.c
> index 6db3d7c..22c566f 100644
> --- a/loader/loader.c
> +++ b/loader/loader.c
> @@ -1809,11 +1809,10 @@ int main(int argc, char ** argv) {
> /* get init PID if we have it */
> if ((f = fopen("/var/run/init.pid", "r")) != NULL) {
> char linebuf[256];
> - memset(linebuf, '', sizeof(linebuf));
>
> - while (fgets(linebuf, sizeof(linebuf) - 1, f) != NULL) {
> + while (fgets(linebuf, sizeof(linebuf), f) != NULL) {
> errno = 0;
> - init_pid = strtol((const char *) &linebuf, NULL, 10);
> + init_pid = strtol(linebuf, NULL, 10);
> if (errno == EINVAL || errno == ERANGE) {
> logMessage(ERROR, "%s (%d): %m", __func__, __LINE__);
> init_pid = 1;


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 12:13 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org