file_create() now also supports FD relative path specifications.

This was the cause for some apps to put their settings files to the current
directory, and also that Tracker did not find some icons (from the icons
it installed in the MIME database).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13645 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2005-07-12 16:33:10 +00:00
parent c552d63dc5
commit 54476a21b5
1 changed files with 4 additions and 4 deletions

View File

@ -3041,7 +3041,7 @@ file_create_entry_ref(mount_id mountID, vnode_id directoryID, const char *name,
static int static int
file_create(char *path, int openMode, int perms, bool kernel) file_create(int fd, char *path, int openMode, int perms, bool kernel)
{ {
char name[B_FILE_NAME_LENGTH]; char name[B_FILE_NAME_LENGTH];
struct vnode *directory; struct vnode *directory;
@ -3050,7 +3050,7 @@ file_create(char *path, int openMode, int perms, bool kernel)
FUNCTION(("file_create: path '%s', omode %x, perms %d, kernel %d\n", path, openMode, perms, kernel)); FUNCTION(("file_create: path '%s', omode %x, perms %d, kernel %d\n", path, openMode, perms, kernel));
// get directory to put the new file in // get directory to put the new file in
status = path_to_dir_vnode(path, &directory, name, kernel); status = fd_and_path_to_dir_vnode(fd, path, &directory, name, kernel);
if (status < 0) if (status < 0)
return status; return status;
@ -5187,7 +5187,7 @@ _kern_open(int fd, const char *path, int openMode, int perms)
return B_NO_MEMORY; return B_NO_MEMORY;
if (openMode & O_CREAT) if (openMode & O_CREAT)
return file_create(pathBuffer.LockBuffer(), openMode, perms, true); return file_create(fd, pathBuffer.LockBuffer(), openMode, perms, true);
return file_open(fd, pathBuffer.LockBuffer(), openMode, true); return file_open(fd, pathBuffer.LockBuffer(), openMode, true);
} }
@ -5965,7 +5965,7 @@ _user_open(int fd, const char *userPath, int openMode, int perms)
return status; return status;
if (openMode & O_CREAT) if (openMode & O_CREAT)
return file_create(path, openMode, perms, false); return file_create(fd, path, openMode, perms, false);
return file_open(fd, path, openMode, false); return file_open(fd, path, openMode, false);
} }