[Top][All Lists]

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

patch for various things

From: Bas Wijnen
Subject: patch for various things
Date: Tue, 1 Jun 2004 01:36:56 +0200
User-agent: Mutt/1.3.28i


I have been reading through some of the source code and documentation, and
fixed some things which I think were wrong.  I put them in one big patch,
which is probably not good, so tell me which parts should not be in there and
I'll remove them :-)

Parts which are not trivial are quoted below, with an explanation of why I
think it should be changed.

I'll not bother writing a ChangeLog entry yet, because I don't expect it to be
accepted unchanged.

Parts with comments:

Here I'd expect a "+ 1" is needed, because it should contain the trailing
'\0'.  However, I'm not sure since it can be compensated.  If this is the
case, there should be a comment about this.

Index: wortel/ia32-cmain.c
RCS file: /cvsroot/hurd/hurd-l4/wortel/ia32-cmain.c,v
retrieving revision 1.11
diff -u -p -r1.11 ia32-cmain.c
--- wortel/ia32-cmain.c 26 Apr 2004 21:15:21 -0000      1.11
+++ wortel/ia32-cmain.c 31 May 2004 23:21:22 -0000
@@ -176,7 +176,7 @@ find_components (void)
       /* Add the argument string of the first module to the list of
         unused pages.  */
       add_unused_area ((l4_word_t) mod[0].string,
-                      strlen ((char *) mod[0].string));
+                      strlen ((char *) mod[0].string) + 1);
       mods_count = mbi->mods_count - 1;
       if (mods_count > MOD_NUMBER)

Here I'd think a non-numerical error message is better, just like many others
in the same file.  There are also quite some which use "(l4_error_code >> 1) &
7", which makes no sense at all to me, because I didn't check the error codes.
Is there a reason why those are also not printed with l4_strerror?

Index: wortel/wortel.c
RCS file: /cvsroot/hurd/hurd-l4/wortel/wortel.c,v
retrieving revision 1.29
diff -u -p -r1.29 wortel.c
--- wortel/wortel.c     26 Apr 2004 21:15:21 -0000      1.29
+++ wortel/wortel.c     31 May 2004 23:21:32 -0000
@@ -331,8 +331,8 @@ start_physmem (void)
   ret = l4_thread_start (physmem, 0, mods[MOD_PHYSMEM].ip);
   if (!ret)
-    panic ("Sending startup message to physmem thread failed: %u",
-          l4_error_code ());
+    panic ("Sending startup message to physmem thread failed: %s",
+          l4_strerror (l4_error_code ()));
   /* Set up the extra threads for physmem.  FIXME: UTCB location has
      the same issues as described above.  */

This panic seems to be copy-pasted from serve_bootstrap_requests.  In
serve_requests a MSG_SHUTDOWN would not be an error I'd think, and even if it
is, the message shouldn't be that the bootstrap failed.

@@ -1096,7 +1096,7 @@ serve_requests (void)
       else if (label == WORTEL_MSG_SHUTDOWN)
-       panic ("Bootstrap failed");
+       shutdown ();
        panic ("Invalid message with tag 0x%x", msg_tag);

The complete patch (with apart from the above some textual fixes) is attached.

Bas Wijnen

I encourage sending me encrypted e-mail.
Please send the central message of e-mails as plain text in the message body,
   not as HTML and definitely not as MS Word.
Please do not use the MS Word format for attachments either.
for more information, see

Attachment: hurd-l4-patch.diff
Description: Text document

Attachment: pgpTxegXUhbIt.pgp
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]