remove incorrect cancellation points from realpath
This commit is contained in:
parent
dfddd43256
commit
35e8621a28
1 changed files with 4 additions and 4 deletions
|
|
@ -1,11 +1,11 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include "syscall.h"
|
||||||
|
|
||||||
void __procfdname(char *, unsigned);
|
void __procfdname(char *, unsigned);
|
||||||
|
|
||||||
|
|
@ -22,7 +22,7 @@ char *realpath(const char *restrict filename, char *restrict resolved)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
fd = open(filename, O_PATH|O_NONBLOCK|O_CLOEXEC);
|
fd = syscall(SYS_open, filename, O_PATH|O_NONBLOCK|O_CLOEXEC|O_LARGEFILE);
|
||||||
if (fd < 0) return 0;
|
if (fd < 0) return 0;
|
||||||
__procfdname(buf, fd);
|
__procfdname(buf, fd);
|
||||||
|
|
||||||
|
|
@ -37,9 +37,9 @@ char *realpath(const char *restrict filename, char *restrict resolved)
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
close(fd);
|
__syscall(SYS_close, fd);
|
||||||
return resolved ? strcpy(resolved, tmp) : strdup(tmp);
|
return resolved ? strcpy(resolved, tmp) : strdup(tmp);
|
||||||
err:
|
err:
|
||||||
close(fd);
|
__syscall(SYS_close, fd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue