Merge commit 'refs/top-bases/gcc-branch' into gcc-branch
This commit is contained in:
commit
d0e6950dd1
|
@ -322,7 +322,7 @@ vn_open(char *path, int x1, int flags, int mode, vnode_t **vpp, int x2, int x3)
|
||||||
int fd;
|
int fd;
|
||||||
vnode_t *vp;
|
vnode_t *vp;
|
||||||
int old_umask;
|
int old_umask;
|
||||||
char realpath[MAXPATHLEN];
|
char real_path[MAXPATHLEN];
|
||||||
struct stat64 st;
|
struct stat64 st;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -345,14 +345,14 @@ vn_open(char *path, int x1, int flags, int mode, vnode_t **vpp, int x2, int x3)
|
||||||
return (errno);
|
return (errno);
|
||||||
}
|
}
|
||||||
close(fd);
|
close(fd);
|
||||||
(void) sprintf(realpath, "%s", path);
|
(void) sprintf(real_path, "%s", path);
|
||||||
dsk = strstr(path, "/dsk/");
|
dsk = strstr(path, "/dsk/");
|
||||||
if (dsk != NULL)
|
if (dsk != NULL)
|
||||||
(void) sprintf(realpath + (dsk - path) + 1, "r%s",
|
(void) sprintf(real_path + (dsk - path) + 1, "r%s",
|
||||||
dsk + 1);
|
dsk + 1);
|
||||||
} else {
|
} else {
|
||||||
(void) sprintf(realpath, "%s", path);
|
(void) sprintf(real_path, "%s", path);
|
||||||
if (!(flags & FCREAT) && stat64(realpath, &st) == -1)
|
if (!(flags & FCREAT) && stat64(real_path, &st) == -1)
|
||||||
return (errno);
|
return (errno);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -363,7 +363,7 @@ vn_open(char *path, int x1, int flags, int mode, vnode_t **vpp, int x2, int x3)
|
||||||
* The construct 'flags - FREAD' conveniently maps combinations of
|
* The construct 'flags - FREAD' conveniently maps combinations of
|
||||||
* FREAD and FWRITE to the corresponding O_RDONLY, O_WRONLY, and O_RDWR.
|
* FREAD and FWRITE to the corresponding O_RDONLY, O_WRONLY, and O_RDWR.
|
||||||
*/
|
*/
|
||||||
fd = open64(realpath, flags - FREAD, mode);
|
fd = open64(real_path, flags - FREAD, mode);
|
||||||
|
|
||||||
if (flags & FCREAT)
|
if (flags & FCREAT)
|
||||||
(void) umask(old_umask);
|
(void) umask(old_umask);
|
||||||
|
@ -392,16 +392,16 @@ int
|
||||||
vn_openat(char *path, int x1, int flags, int mode, vnode_t **vpp, int x2,
|
vn_openat(char *path, int x1, int flags, int mode, vnode_t **vpp, int x2,
|
||||||
int x3, vnode_t *startvp, int fd)
|
int x3, vnode_t *startvp, int fd)
|
||||||
{
|
{
|
||||||
char *realpath = umem_alloc(strlen(path) + 2, UMEM_NOFAIL);
|
char *real_path = umem_alloc(strlen(path) + 2, UMEM_NOFAIL);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ASSERT(startvp == rootdir);
|
ASSERT(startvp == rootdir);
|
||||||
(void) sprintf(realpath, "/%s", path);
|
(void) sprintf(real_path, "/%s", path);
|
||||||
|
|
||||||
/* fd ignored for now, need if want to simulate nbmand support */
|
/* fd ignored for now, need if want to simulate nbmand support */
|
||||||
ret = vn_open(realpath, x1, flags, mode, vpp, x2, x3);
|
ret = vn_open(real_path, x1, flags, mode, vpp, x2, x3);
|
||||||
|
|
||||||
umem_free(realpath, strlen(path) + 2);
|
umem_free(real_path, strlen(path) + 2);
|
||||||
|
|
||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
|
@ -743,11 +743,11 @@ random_get_pseudo_bytes(uint8_t *ptr, size_t len)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ddi_strtoul(const char *hw_serial, char **nptr, int base, unsigned long *result)
|
ddi_strtoul(const char *serial, char **nptr, int base, unsigned long *result)
|
||||||
{
|
{
|
||||||
char *end;
|
char *end;
|
||||||
|
|
||||||
*result = strtoul(hw_serial, &end, base);
|
*result = strtoul(serial, &end, base);
|
||||||
if (*result == 0)
|
if (*result == 0)
|
||||||
return (errno);
|
return (errno);
|
||||||
return (0);
|
return (0);
|
||||||
|
|
Loading…
Reference in New Issue