smbfs_open(): Implement O_APPEND via smbfs_lseek()
- From: "Andrew V. Samoilov" <andrew email zp ua>
- To: mc-devel gnome org
- Subject: smbfs_open(): Implement O_APPEND via smbfs_lseek()
- Date: Thu, 19 Aug 2004 21:47:25 +0300 (EEST)
Hello,
any complains/side effects?
--
Regards,
Andrew V. Samoilov.
vfs/ChangeLog:
2004-08-xx Andrew V. Samoilov <sav bcs zp ua>
* smbfs.c (smbfs_open_readwrite): Implement O_APPEND via smbfs_lseek().
--- mc/vfs/smbfs.c Thu Aug 19 11:59:35 2004
+++ mc/vfs/smbfs.c Thu Aug 19 21:26:14 2004
@@ -1747,8 +1747,10 @@ smbfs_open_readwrite (smbfs_handle *remo
DEBUG (3, ("smbfs_open: O_TRUNC\n"));
remote_handle->fnum =
- cli_open (remote_handle->cli, rname, flags & O_CREAT ? flags : O_RDONLY,
- DENY_NONE);
+ cli_open (remote_handle->cli, rname, ((flags & O_CREAT)
+ || (flags ==
+ (O_WRONLY | O_APPEND))) ?
+ flags : O_RDONLY, DENY_NONE);
if (remote_handle->fnum == -1) {
message (1, MSG_ERROR, _(" %s opening remote file %s "),
@@ -1776,6 +1778,12 @@ smbfs_open_readwrite (smbfs_handle *remo
cli_close (remote_handle->cli, remote_handle->fnum);
return NULL;
}
+
+ if ((flags == (O_WRONLY | O_APPEND)) /* file.c:copy_file_file() -> do_append */
+ && smbfs_lseek (remote_handle, 0, SEEK_END) == -1) {
+ cli_close (remote_handle->cli, remote_handle->fnum);
+ return NULL;
+ }
return remote_handle;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]