3486 /* copy everything up to the base name */
3487 q = name;
3488 while (q != b && *q)
3489 *p++ = *q++;
3490 s = slash_moddir_suffix_slash;
3491 while (*s)
3492 *p++ = *s++;
3493 /* copy the rest */
3494 while (*b)
3495 *p++ = *b++;
3496 } else {
3497 q = name;
3498 while (*q)
3499 *p++ = *q++;
3500 }
3501 *p = 0;
3502 if ((file = kobj_open_file(fullname)) != (struct _buf *)-1) {
3503 kobj_free(fullname, maxpathlen);
3504 return (file);
3505 }
3506 while (*pathp == ' ')
3507 pathp++;
3508 if (*pathp == 0)
3509 break;
3510
3511 }
3512 kobj_free(fullname, maxpathlen);
3513 if (_moddebug & MODDEBUG_ERRMSG) {
3514 _kobj_printf(ops, "can't open %s,", name);
3515 _kobj_printf(ops, " path is %s\n", pathpsave);
3516 }
3517 return ((struct _buf *)-1);
3518 }
3519
3520 intptr_t
3521 kobj_open(char *filename)
3522 {
3523 struct vnode *vp;
3524 int fd;
3525
3526 if (_modrootloaded) {
|
3486 /* copy everything up to the base name */
3487 q = name;
3488 while (q != b && *q)
3489 *p++ = *q++;
3490 s = slash_moddir_suffix_slash;
3491 while (*s)
3492 *p++ = *s++;
3493 /* copy the rest */
3494 while (*b)
3495 *p++ = *b++;
3496 } else {
3497 q = name;
3498 while (*q)
3499 *p++ = *q++;
3500 }
3501 *p = 0;
3502 if ((file = kobj_open_file(fullname)) != (struct _buf *)-1) {
3503 kobj_free(fullname, maxpathlen);
3504 return (file);
3505 }
3506 while (*pathp == ' ' || *pathp == ':')
3507 pathp++;
3508 if (*pathp == 0)
3509 break;
3510
3511 }
3512 kobj_free(fullname, maxpathlen);
3513 if (_moddebug & MODDEBUG_ERRMSG) {
3514 _kobj_printf(ops, "can't open %s,", name);
3515 _kobj_printf(ops, " path is %s\n", pathpsave);
3516 }
3517 return ((struct _buf *)-1);
3518 }
3519
3520 intptr_t
3521 kobj_open(char *filename)
3522 {
3523 struct vnode *vp;
3524 int fd;
3525
3526 if (_modrootloaded) {
|