libposix: fix POSIX_open's DMDIR management; fix typo in POSIX_chmod
This commit is contained in:
parent
511bbd36af
commit
6a94e587a6
|
@ -125,9 +125,11 @@ POSIX_open(int *errnop, const char *name, int flags, int mode)
|
||||||
goto FailWithError;
|
goto FailWithError;
|
||||||
if(omode & DMDIR){
|
if(omode & DMDIR){
|
||||||
d = dirstat(name);
|
d = dirstat(name);
|
||||||
|
if(d != nil){
|
||||||
if((d->mode & DMDIR) == 0)
|
if((d->mode & DMDIR) == 0)
|
||||||
e = PosixENOTDIR;
|
e = PosixENOTDIR;
|
||||||
free(d);
|
free(d);
|
||||||
|
}
|
||||||
if(e != 0)
|
if(e != 0)
|
||||||
goto FailWithError;
|
goto FailWithError;
|
||||||
omode &= ~DMDIR;
|
omode &= ~DMDIR;
|
||||||
|
@ -375,7 +377,7 @@ POSIX_stat(int *errnop, const char *file, void *pstat)
|
||||||
int
|
int
|
||||||
POSIX_chmod(int *errnop, const char *path, int mode)
|
POSIX_chmod(int *errnop, const char *path, int mode)
|
||||||
{
|
{
|
||||||
long cmode = 0;
|
long cperm = 0;
|
||||||
PosixError e;
|
PosixError e;
|
||||||
|
|
||||||
e = __libposix_open_translation(0, mode, nil, &cperm);
|
e = __libposix_open_translation(0, mode, nil, &cperm);
|
||||||
|
|
Loading…
Reference in New Issue