(note: EINTR re-read differs from vfs_write_data)
****************************************************************************/
-static ssize_t printing_read_data(files_struct *fsp,
+static ssize_t printing_pread_data(files_struct *fsp,
char *buf,
+ off_t *poff_unused,
size_t byte_count)
{
size_t total=0;
ssize_t byte_count;
off_t oret;
off_t pos;
+ off_t in_pos = -1;
int ret = -1;
/* Just skip over optional header to get to section table */
goto out;
}
- byte_count = printing_read_data(fsp, buf, section_table_bytes);
+ byte_count = printing_pread_data(fsp, buf, &in_pos, section_table_bytes);
if (byte_count < section_table_bytes) {
DBG_NOTICE("PE file [%s] Section header too short, "
"bytes read = %lu\n",
goto out;
}
- byte_count = printing_read_data(fsp,
+ byte_count = printing_pread_data(fsp,
buf,
+ &in_pos,
section_bytes);
if (byte_count < section_bytes) {
DBG_NOTICE("PE file "
unsigned int i;
ssize_t byte_count;
int ret = -1;
+ off_t in_pos = -1;
if (CVAL(buf,NE_HEADER_TARGET_OS_OFFSET) != NE_HEADER_TARGOS_WIN ) {
DBG_NOTICE("NE file [%s] wrong target OS = 0x%x\n",
* please have at it, but this works. 'NE' files will
* eventually fade away. JRR
*/
- byte_count = printing_read_data(fsp, buf, VS_NE_BUF_SIZE);
+ byte_count = printing_pread_data(fsp, buf, &in_pos, VS_NE_BUF_SIZE);
while (byte_count > 0) {
/*
* Cover case that should not occur in a well
* possibly match
*/
if (buf[i] != 'V') {
- byte_count = printing_read_data(fsp,
+ byte_count = printing_pread_data(fsp,
buf,
+ &in_pos,
VS_NE_BUF_SIZE);
continue;
}
ssize_t amount_unused = byte_count-i;
memmove(buf, &buf[i], amount_unused);
- amount_read = printing_read_data(fsp,
+ amount_read = printing_pread_data(fsp,
&buf[amount_unused],
+ &in_pos,
VS_NE_BUF_SIZE- amount_unused);
if (amount_read < 0) {
DBG_ERR("NE file [%s] Read "
if (IVAL(buf,
i+sizeof(VS_SIGNATURE)+skip)
!= 0xfeef04bd) {
- byte_count = printing_read_data(fsp,
+ byte_count = printing_pread_data(fsp,
buf,
+ &in_pos,
VS_NE_BUF_SIZE);
continue;
}
ssize_t byte_count;
off_t pos;
off_t oret;
+ off_t in_pos = -1;
buf=(char *)SMB_MALLOC(DOS_HEADER_SIZE);
if (buf == NULL) {
goto error_exit;
}
- byte_count = printing_read_data(fsp, buf, DOS_HEADER_SIZE);
+ byte_count = printing_pread_data(fsp, buf, &in_pos, DOS_HEADER_SIZE);
if (byte_count < DOS_HEADER_SIZE) {
DBG_NOTICE("File [%s] DOS header too short, bytes read = %lu\n",
fname,
pos = oret; /* Update new position. */
/* Note: DOS_HEADER_SIZE and NE_HEADER_SIZE are incidentally same */
- byte_count = printing_read_data(fsp, buf, NE_HEADER_SIZE);
+ byte_count = printing_pread_data(fsp, buf, &in_pos, NE_HEADER_SIZE);
if (byte_count < NE_HEADER_SIZE) {
DBG_NOTICE("File [%s] Windows header too short, "
"bytes read = %lu\n",