obhq / obliteration

Experimental free and open-source PlayStation 4 kernel
https://obliteration.net
Apache License 2.0
623 stars 17 forks source link

Fixes raw_open and microtime on windows #772

Closed SuchAFuriousDeath closed 6 months ago

ultimaweapon commented 6 months ago

@VocalFan have you understand what the code does before approving? As I said before that the rule of thumb is do not approve if you don't understand what the code does.

VocalFan commented 6 months ago

Boy, I may be dumb in the deeper things... But we BOTH dived into this code before.

ultimaweapon commented 6 months ago

If you understand then can you explain #773?

VocalFan commented 6 months ago

If you understand then can you explain #773?

Yep... File_OPEN only reads and opens the file if available, and errors if not available... Though normally, the /dev and /mnt folders already exist, you would... Want a fallback where if it DOES error, then create it with File_CREATE. Thing is it seems we have to do it in this order as File_CREATE just throws an error if the file does already exist.

VocalFan commented 6 months ago

If you understand then can you explain #773?

Hey, your implementation was broken too, so you can't be mad when we go from a non-working fix to a half-working fix that... If the folders already exist... We reach

    pub fn open(&self, path: impl AsRef<VPath>, td: Option<&VThread>) -> Result<VFile, OpenError> {
        let vnode = self
            .lookup(path, true, td)
            .map_err(OpenError::LookupFailed)?;

        todo!();
    }
ultimaweapon commented 6 months ago

If you understand then can you explain #773?

Yep... File_OPEN only reads and opens the file if available, and errors if not available... Though normally, the /dev and /mnt folders already exist, you would... Want a fallback where if it DOES error, then create it with File_CREATE. Thing is it seems we have to do it in this order as File_CREATE just throws an error if the file does already exist.

https://github.com/obhq/obliteration/blob/main/src/kernel/src/fs/mod.rs#L111-L127

And raw_mkdir need to behave in the same way for both Windows and *nix, which is already correct before this PR. Next time please don't approve any PRs that has any changes on how the code work. You still can approve the other PRs like display string updates, grammar fix, etc.

SuchAFuriousDeath commented 6 months ago

This is actually something I was unsure about and wanted to figure out during the review process.