mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-03-30 10:55:03 +00:00
d_path: "\0" is {0,0}, not {0}
Single-element array consisting of one NUL is spelled ""... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
6efb943b86
commit
dfe5087675
1 changed files with 5 additions and 5 deletions
10
fs/d_path.c
10
fs/d_path.c
|
@ -184,7 +184,7 @@ char *__d_path(const struct path *path,
|
||||||
char *res = buf + buflen;
|
char *res = buf + buflen;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
prepend(&res, &buflen, "\0", 1);
|
prepend(&res, &buflen, "", 1);
|
||||||
error = prepend_path(path, root, &res, &buflen);
|
error = prepend_path(path, root, &res, &buflen);
|
||||||
|
|
||||||
if (error < 0)
|
if (error < 0)
|
||||||
|
@ -201,7 +201,7 @@ char *d_absolute_path(const struct path *path,
|
||||||
char *res = buf + buflen;
|
char *res = buf + buflen;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
prepend(&res, &buflen, "\0", 1);
|
prepend(&res, &buflen, "", 1);
|
||||||
error = prepend_path(path, &root, &res, &buflen);
|
error = prepend_path(path, &root, &res, &buflen);
|
||||||
|
|
||||||
if (error > 1)
|
if (error > 1)
|
||||||
|
@ -218,7 +218,7 @@ static int path_with_deleted(const struct path *path,
|
||||||
const struct path *root,
|
const struct path *root,
|
||||||
char **buf, int *buflen)
|
char **buf, int *buflen)
|
||||||
{
|
{
|
||||||
prepend(buf, buflen, "\0", 1);
|
prepend(buf, buflen, "", 1);
|
||||||
if (d_unlinked(path->dentry)) {
|
if (d_unlinked(path->dentry)) {
|
||||||
int error = prepend(buf, buflen, " (deleted)", 10);
|
int error = prepend(buf, buflen, " (deleted)", 10);
|
||||||
if (error)
|
if (error)
|
||||||
|
@ -341,7 +341,7 @@ restart:
|
||||||
dentry = d;
|
dentry = d;
|
||||||
end = buf + buflen;
|
end = buf + buflen;
|
||||||
len = buflen;
|
len = buflen;
|
||||||
prepend(&end, &len, "\0", 1);
|
prepend(&end, &len, "", 1);
|
||||||
/* Get '/' right */
|
/* Get '/' right */
|
||||||
retval = end-1;
|
retval = end-1;
|
||||||
*retval = '/';
|
*retval = '/';
|
||||||
|
@ -444,7 +444,7 @@ SYSCALL_DEFINE2(getcwd, char __user *, buf, unsigned long, size)
|
||||||
char *cwd = page + PATH_MAX;
|
char *cwd = page + PATH_MAX;
|
||||||
int buflen = PATH_MAX;
|
int buflen = PATH_MAX;
|
||||||
|
|
||||||
prepend(&cwd, &buflen, "\0", 1);
|
prepend(&cwd, &buflen, "", 1);
|
||||||
error = prepend_path(&pwd, &root, &cwd, &buflen);
|
error = prepend_path(&pwd, &root, &cwd, &buflen);
|
||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue