Mercurial > gftp.yaz
comparison lib/local.c @ 182:33b394ebba68
2003-6-15 Brian Masney <masneyb@gftp.org>
* lib/cache.c lib/gftp.h - added gftp_generate_cache_description().
* lib/cache.c lib/gftp.h src/text/gftp-text.c src/gtk/delete-dialog.c
src/gtk/menu-items.c src/gtk/misc-gtk.c src/gtk/mkdir-dialog.c - Added
description parameter to gftp_delete_cache_entry().
* lib/protocols.c lib/gftp.h - added gftp_fd_open(). It will call
open() and then set the socket option close on exec
* lib/cache.c lib/local.c lib/misc.c - use gftp_fd_open() instead of
open()
* lib/rfc959.c lib/protocols.c - on newly created sockets, make sure
the close on exec socket option is set
* lib/options.h src/text/gftp-text.c src/gtk/transfer.c - added
preserve_permissions option
* lib/protocols.c (gftp_parse_url) - allow an @ to be in the username
* src/text/gftp-text.c - after transfering a file, honor
preserve_permissions if it is set
* src/gtk/delete-dialog.c - improvments to clearing the expired cache
entries
author | masneyb |
---|---|
date | Sun, 15 Jun 2003 21:28:02 +0000 |
parents | aec4b4541d3a |
children | 13ca1defdc75 |
comparison
equal
deleted
inserted
replaced
181:0153a867819c | 182:33b394ebba68 |
---|---|
118 flags = O_RDONLY; | 118 flags = O_RDONLY; |
119 #if defined (_LARGEFILE_SOURCE) | 119 #if defined (_LARGEFILE_SOURCE) |
120 flags |= O_LARGEFILE; | 120 flags |= O_LARGEFILE; |
121 #endif | 121 #endif |
122 | 122 |
123 if ((request->datafd = open (filename, flags)) == -1) | 123 if ((request->datafd = gftp_fd_open (request, filename, flags, 0)) == -1) |
124 { | 124 return (GFTP_ERETRYABLE); |
125 request->logging_function (gftp_logging_error, request->user_data, | |
126 _("Error: Cannot open local file %s: %s\n"), | |
127 filename, g_strerror (errno)); | |
128 return (GFTP_ERETRYABLE); | |
129 } | |
130 } | 125 } |
131 else | 126 else |
132 request->datafd = fd; | 127 request->datafd = fd; |
133 | 128 |
134 if ((size = lseek (request->datafd, 0, SEEK_END)) == -1) | 129 if ((size = lseek (request->datafd, 0, SEEK_END)) == -1) |
170 flags |= O_APPEND; | 165 flags |= O_APPEND; |
171 #if defined (_LARGEFILE_SOURCE) | 166 #if defined (_LARGEFILE_SOURCE) |
172 flags |= O_LARGEFILE; | 167 flags |= O_LARGEFILE; |
173 #endif | 168 #endif |
174 | 169 |
175 if ((request->datafd = open (filename, flags, S_IRUSR | S_IWUSR)) == -1) | 170 if ((request->datafd = gftp_fd_open (request, filename, flags, 0)) == -1) |
176 { | 171 return (GFTP_ERETRYABLE); |
177 request->logging_function (gftp_logging_error, request->user_data, | |
178 _("Error: Cannot open local file %s: %s\n"), | |
179 filename, g_strerror (errno)); | |
180 return (GFTP_ERETRYABLE); | |
181 } | |
182 } | 172 } |
183 else | 173 else |
184 request->datafd = fd; | 174 request->datafd = fd; |
185 | 175 |
186 if (ftruncate (request->datafd, startsize) == -1) | 176 if (ftruncate (request->datafd, startsize) == -1) |