Panic if there is no slash or dot in namec
authorRonald G. Minnich <rminnich@google.com>
Sat, 18 Jan 2014 02:47:09 +0000 (18:47 -0800)
committerRonald G. Minnich <rminnich@google.com>
Sat, 18 Jan 2014 02:47:09 +0000 (18:47 -0800)
Because that's just wrong.

Signed-off-by: Ronald G. Minnich <rminnich@google.com>
kern/src/ns/chan.c

index c0248ae..b30b18a 100644 (file)
@@ -991,7 +991,9 @@ namec(char *aname, int amode, int omode, uint32_t perm)
        nomount = 0;
        switch(name[0]){
        case '/':
        nomount = 0;
        switch(name[0]){
        case '/':
-               c = current->pgrp->slash;
+               c = current->slash;
+               if (! c)
+                       panic("no slash!");
                kref_get(&c->ref, 1);
                break;
        
                kref_get(&c->ref, 1);
                break;
        
@@ -1033,7 +1035,9 @@ namec(char *aname, int amode, int omode, uint32_t perm)
                break;
 
        default:
                break;
 
        default:
-               c = current->pgrp->dot;
+               c = current->dot;
+               if (! c)
+                       panic("no dot!");
                kref_get(&c->ref, 1);
                break;
        }
                kref_get(&c->ref, 1);
                break;
        }