Thread: Fork(), pause(), and storing PID's in a linked list

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    But "List" is a different variable than your list, which with the current design is held by "Current".

    It may be prudent to check if "list->next" is not NULL too...

    Edit: Just remove the "current" in main, remove "list" from the CreateProcess, and use "&list" instead of "&current", and it should work fine.

    Of course, there are other problems in your code: counter in "createprocess" is a pointer, not an integer. It will not work as you expect.

    And I still reccon that you aren't using -Wall (or you are ignoring the warnings), because it should give you at least half a dozen or more warnings the way you are mixing and matching different pointers in various places.

    --
    Mats
    Last edited by matsp; 09-26-2007 at 07:51 AM.
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed