Break out of open without checking 9ns if EEXIST
[akaros.git] / kern / src / syscall.c
index 73e42c0..ff9b064 100644 (file)
@@ -1142,6 +1142,8 @@ static intreg_t sys_open(struct proc *p, const char *path, size_t path_l,
                if (fd < 0)
                        warn("File insertion failed");
        } else {
+               if (get_errno() == EEXIST)
+                       return -1;
                unset_errno();  /* Go can't handle extra errnos */
                fd = sysopen(t_path, oflag);
                /* successful lookup with CREATE and EXCL is an error */