[Fastboot] [PATCH]ppc64 kexec tools rm platform fix
Michael Ellerman
michaelellerman at internode.on.net
Tue Apr 11 19:36:49 EST 2006
David Wilder wrote:
> I lost Michael's reply on the list.
> Here it is with my response..
>
> Michael wrote:
>
> >/ - continue;
> />/ - }
> />/ memset(fname, 0, sizeof(fname));
> />/ strcpy(fname, device_tree);
> />/ strcat(fname, dentry->d_name);
> />/ strcat(fname, "/linux,htab-base");
> />/ if ((file = fopen(fname, "r")) == NULL) {
> />/ - perror(fname);
> />/ closedir(cdir);
> />/ + if (errno == ENOENT) {
> />/ + /* Non LPAR */
> />/ + errno = 0;
> />/ + continue;
> />/ + }
> />/ + perror(fname);
> />/ closedir(dir);
> />/ return -1;
> /
> I don't think you want to do the closedir() before the if. You
> certainly
> don't need to do it twice?
>
> The two closedir() calls are not closing the same thing.
Right. We don't seem to close cdir if it all works though. That code
needs some serious restructuring, 350+ line functions are not cool.
cheers
--
Michael Ellerman
IBM OzLabs
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)
We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
More information about the Linuxppc-dev
mailing list