Changeset View
Changeset View
Standalone View
Standalone View
smb/kio_smb_file.cpp
Show First 20 Lines • Show All 291 Lines • ▼ Show 20 Line(s) | 291 | if (res == (off_t)-1) { | |||
---|---|---|---|---|---|
292 | error(KIO::ERR_CANNOT_SEEK, m_openUrl.path()); | 292 | error(KIO::ERR_CANNOT_SEEK, m_openUrl.path()); | ||
293 | closeWithoutFinish(); | 293 | closeWithoutFinish(); | ||
294 | } else { | 294 | } else { | ||
295 | qCDebug( KIO_SMB ) << "res" << res; | 295 | qCDebug( KIO_SMB ) << "res" << res; | ||
296 | position( res ); | 296 | position( res ); | ||
297 | } | 297 | } | ||
298 | } | 298 | } | ||
299 | 299 | | |||
300 | void SMBSlave::truncate(KIO::filesize_t length) | ||||
301 | { | ||||
302 | off_t res = smbc_ftruncate(m_openFd, static_cast<off_t>(length)); | ||||
303 | if (res < 0) { | ||||
304 | error(KIO::ERR_CANNOT_TRUNCATE, m_openUrl.path()); | ||||
305 | closeWithoutFinish(); | ||||
306 | } else { | ||||
307 | qCDebug( KIO_SMB ) << "res" << res; | ||||
308 | truncated(length); | ||||
309 | } | ||||
310 | } | ||||
311 | | ||||
300 | void SMBSlave::closeWithoutFinish() | 312 | void SMBSlave::closeWithoutFinish() | ||
301 | { | 313 | { | ||
302 | smbc_close(m_openFd); | 314 | smbc_close(m_openFd); | ||
303 | } | 315 | } | ||
304 | 316 | | |||
305 | void SMBSlave::close() | 317 | void SMBSlave::close() | ||
306 | { | 318 | { | ||
307 | closeWithoutFinish(); | 319 | closeWithoutFinish(); | ||
▲ Show 20 Lines • Show All 163 Lines • Show Last 20 Lines |