[PATCH] reIPL code cleanup in loader

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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, '\0', 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@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux