Kernel/messages - Fixed IPCMSG flag not being reset when message queue is non-empty
authorJohn Hodge (sonata) <[email protected]>
Wed, 28 Nov 2012 03:30:24 +0000 (11:30 +0800)
committerJohn Hodge (sonata) <[email protected]>
Wed, 28 Nov 2012 03:30:24 +0000 (11:30 +0800)
- Also fixed error in %p printing of NULL

KernelLand/Kernel/libc.c
KernelLand/Kernel/messages.c

index c6df2cd..8674650 100644 (file)
@@ -228,8 +228,12 @@ int vsnprintf(char *__s, size_t __maxlen, const char *__format, va_list args)
                        PUTCH('*');     PUTCH('0');     PUTCH('x');
                        for( len = BITS/4; len -- && ((ptr>>(len*4))&15) == 0; )
                                ;
-                       for( len ++; len --; )
-                               PUTCH( cUCDIGITS[ (ptr>>(len*4))&15 ] );
+                       len ++;
+                       if( len == 0 )
+                               PUTCH( '0' );
+                       else
+                               while( len -- )
+                                       PUTCH( cUCDIGITS[ (ptr>>(len*4))&15 ] );
                        continue ;
                }
                
index c991978..8237423 100644 (file)
@@ -137,10 +137,13 @@ int Proc_GetMessage(Uint *Source, Uint BufSize, void *Buffer)
        // Remove from list
        tmp = cur->Messages;
        cur->Messages = cur->Messages->Next;
+       // - Removed last message? Clear the end-of-list pointer
        if(cur->Messages == NULL)       cur->LastMessage = NULL;
+       //  > Otherwise, re-mark the IPCMSG event flag
+       else    cur->EventState |= THREAD_EVENT_IPCMSG;
        
        SHORTREL( &cur->IsLocked );
-       
+
        free(tmp);      // Free outside of lock
 
        LEAVE('i', ret);

UCC git Repository :: git.ucc.asn.au