fix the spaces and tabs
@@ -411,16 +411,16 @@ sysreturn open_internal(tuple n, int flags, int mode)
bytes length;
heap h = heap_general(get_kernel_heaps());
unix_heaps uh = get_unix_heaps();
-
- // buffer b = allocate(h, sizeof(struct buffer));
// might be functional, or be a directory
file f = unix_cache_alloc(uh, file);
- if (f == INVALID_ADDRESS) {
+ if (f == INVALID_ADDRESS)
+ {
msg_err("failed to allocate struct file\n");
return set_syscall_error(current, ENOMEM);
}
int fd = allocate_fd(current->p, f);
- if (fd == INVALID_PHYSICAL) {
+ if (fd == INVALID_PHYSICAL)
+ {
unix_cache_free(uh, file, f);
return set_syscall_error(current, EMFILE);
}
@@ -437,7 +437,8 @@ sysreturn open(char *name, int flags, int mode)
// fix - lookup should be robust
if (name == 0)
return set_syscall_error (current, EINVAL);
- if (!(n = resolve_cstring(current->p->cwd, name))) {
+ if (!(n = resolve_cstring(current->p->cwd, name)))
+ {
rprintf("open %s - not found\n", name);
return set_syscall_error(current, ENOENT);
}
@@ -463,11 +464,13 @@ sysreturn openat(int dirfd, char *name, int flags, int mode)
if (name == 0)
return set_syscall_error (current, EINVAL);
// dirfs == AT_FDCWS or path is absolute
- if (dirfd == AT_FDCWD || *name == '/') {
+ if (dirfd == AT_FDCWD || *name == '/')
+ {
return open(name, flags, mode);
}
file f = resolve_fd(current->p, dirfd);
- if (!f) {
+ if (!f)
+ {
return EINVAL;
}
return open_internal(f->n, flags, mode);
